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
A has_child
or other p/c query wrapped in a query filter may emit wrong results
#7685
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clintongormley
changed the title
Parent/child: has_child or other p/c query wrapped in a query filter may emit wrong results
Parent/Child: has_child or other p/c query wrapped in a query filter may emit wrong results
Sep 11, 2014
LGTM |
@@ -151,8 +152,8 @@ public static Filter wrap(Query query) { | |||
// and potentially miss a forbidden API usage! | |||
private static final class QueryWrapperFilterFactory { | |||
|
|||
public Filter wrap(Query query) { | |||
if (CustomQueryWrappingFilter.shouldUseCustomQueryWrappingFilter(query)) { | |||
public Filter wrap(Query query, QueryParseContext context) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@martijnvg I think you should take the time to add some javadocs to this :) please but feel free to push anyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:) will do
clintongormley
added
v1.4.0.Beta
v1.4.0.Beta1
and removed
v1.4.0.Beta1
v1.4.0.Beta
labels
Sep 12, 2014
…QueryWrappingFilter must always be used and any filter wrapping the query filter must never be cached. Closes elastic#7685
martijnvg
force-pushed
the
bug/pc-wrapped-query-filter
branch
from
September 12, 2014 14:44
53e2650
to
172ec64
Compare
martijnvg
added a commit
that referenced
this pull request
Sep 12, 2014
…QueryWrappingFilter must always be used and any filter wrapping the query filter must never be cached. Closes #7685
martijnvg
added a commit
that referenced
this pull request
Sep 12, 2014
…QueryWrappingFilter must always be used and any filter wrapping the query filter must never be cached. Closes #7685
martijnvg
added a commit
that referenced
this pull request
Sep 12, 2014
…QueryWrappingFilter must always be used and any filter wrapping the query filter must never be cached. Closes #7685
clintongormley
changed the title
Parent/Child: has_child or other p/c query wrapped in a query filter may emit wrong results
A Jun 7, 2015
has_child
or other p/c query wrapped in a query filter may emit wrong results
mute
pushed a commit
to mute/elasticsearch
that referenced
this pull request
Jul 29, 2015
…QueryWrappingFilter must always be used and any filter wrapping the query filter must never be cached. Closes elastic#7685
mute
pushed a commit
to mute/elasticsearch
that referenced
this pull request
Jul 29, 2015
…QueryWrappingFilter must always be used and any filter wrapping the query filter must never be cached. Closes elastic#7685
clintongormley
added
:Search/Search
Search-related issues that do not fall into other categories
and removed
:Parent/Child
labels
Feb 14, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
>bug
:Search/Search
Search-related issues that do not fall into other categories
v1.3.3
v1.4.0.Beta1
v2.0.0-beta1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If a
has_child
,has_parent
ortop_children
is indirectly wrapped in aquery
filter (for example via abool
query) then the results are incorrect. This bug manifests in all places in the dsl wherequery
filter can be used.This PR lets the
query
filter use theCustomQueryWrappingFilter
class if the query being wrapped in aquery
filter indirectly uses a p/c query. (the case when p/c query was directly being wrapped was already covered).Also if a
query
filter is wrapping a p/c query (either directly or indirectly) any filter wrapping it if forcefully never cached. Caching this would also lead to wrong results, since the p/c queries can't be cached per segment, while regular filter can.