New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query DSL: Wrong result on bool filter with 'must_not' and 'geo_distance' #4130
Labels
Comments
ghost
assigned martijnvg
Nov 8, 2013
@Akii Thanks for reporting this! I can verify this issue and will fix it soon. |
Wow that was quick. Thanks a lot! |
martijnvg
added a commit
to martijnvg/elasticsearch
that referenced
this issue
Nov 12, 2013
…y are hits. There is an optimization that executes bit based (slow) filters in the end. Matched docs could be unset if they didn't match with any of these filters. The bug was that also iterator based (fast) filters should be checked. This change checks all should filters in the end part (if must or must_not clauses exists), so it can now correctly unset matched docs. The current bool filters requires that at least one should clause must match for docs to be match regardless of any other clauses. Closes elastic#4130
martijnvg
added a commit
that referenced
this issue
Nov 13, 2013
…y are hits. There is an optimization that executes bit based (slow) filters in the end. Matched docs could be unset if they didn't match with any of these filters. The bug was that also iterator based (fast) filters should be checked. This change checks all should filters in the end part (if must or must_not clauses exists), so it can now correctly unset matched docs. The current bool filters requires that at least one should clause must match for docs to be match regardless of any other clauses. Closes #4130
mute
pushed a commit
to mute/elasticsearch
that referenced
this issue
Jul 29, 2015
…y are hits. There is an optimization that executes bit based (slow) filters in the end. Matched docs could be unset if they didn't match with any of these filters. The bug was that also iterator based (fast) filters should be checked. This change checks all should filters in the end part (if must or must_not clauses exists), so it can now correctly unset matched docs. The current bool filters requires that at least one should clause must match for docs to be match regardless of any other clauses. Closes elastic#4130
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The Bool Filter returns the wrong result when combining the 'must_not' (or 'must') part with a 'should' containing a 'geo_distance' filter.
Consider following example:
Example query 1:
This returns only the document with the id 3. It should return both, 2 and 3 because 2 also matches the 'should' part. Document with id 1 is excluded as expected.
Example query 2:
This returns all 3 documents as expected. Note that the 'must_not' part has been removed. Bool filter works as expected.
Example query 3:
This will correctly return only the document with id 2. The example above does not show this.. and it's kinda late now. You can remove either the 'should not' or the 'geo_distance' and the query will execute correctly.
The text was updated successfully, but these errors were encountered: