Difference between "text" AND query and "bool" MUST query


(Nitish Sharma) #1

Hi,
While performing some tests to check how ES behaves if one of the query
keywords is a stop word (for e.g. the), I came across a weird behaviour. If
I perform a "text" AND query for "The queen" (looks like
https://gist.github.com/2867311) then I get some results back. But
performing a bool query with must clause for "the" and "queen" does not
return any results (https://gist.github.com/2867307).
In my understanding, a text AND query can be directly mapped to a bool MUST
query. Apparently, that is not the case.
Is this an expected behaviour of ES?

Cheers
Nitish


(Igor Motov) #2

In the first case, the stop word is getting dropped during parsing and your
query is translated into text:queen, which returns results.

In the second case the first part is translated into special MatchNoDocs
boolean query that returns no results, and then it is combined
with +(text:queen user_name:queen) using AND operator. As a result the
combined query returns no results.

On Monday, June 4, 2012 5:29:30 AM UTC-4, Nitish Sharma wrote:

Hi,
While performing some tests to check how ES behaves if one of the query
keywords is a stop word (for e.g. the), I came across a weird behaviour. If
I perform a "text" AND query for "The queen" (looks like
https://gist.github.com/2867311) then I get some results back. But
performing a bool query with must clause for "the" and "queen" does not
return any results (https://gist.github.com/2867307).
In my understanding, a text AND query can be directly mapped to a bool
MUST query. Apparently, that is not the case.
Is this an expected behaviour of ES?

Cheers
Nitish


(system) #3