How can I search for word parts with operator AND

I have a field in my index which is using hyphenation decompounder for german.

When I index a document with the value "Anfrage-7078437-991506 (1).P93" this leads to the tokens "Anfrage", "frage", "7078437", "991506", "1" and "P93".

A search with MatchQuery for "Preisanfrage" and the operator AND has this document as result.
"Preisanfrage" leads to the tokens "Preisanfrage" and "frage".

My question is: Why isn't AND used and only a document with "Preisanfrage" and "frage" is returned?
Or is there something I can do to get this result.

So, the reason for this is, that a single input term Preisanfrage generates more than one output term Preisanfrage & frage and those will be combined with an or (as it would be confusing if an additional generated term during analysis would lead to a document not being returned at all, despite being an exact match for the term that was typed in).

The operator AND refers to the case when two input terms are send in the search request like spam eggs - then this will become a spam AND eggs query, regardless to what a single term expands to after analysis.

Hope that helps to understand. the issue.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.