Skip to content
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

has_child filter and query yield inconsistent results #4306

Closed
martijnvg opened this issue Nov 30, 2013 · 0 comments
Closed

has_child filter and query yield inconsistent results #4306

martijnvg opened this issue Nov 30, 2013 · 0 comments

Comments

@martijnvg
Copy link
Member

Document marked as deleted are not taken into account:

  • The deleted docs are not being applied in the has_child query, which they should and were taken into account in has_child filter which isn't necessary.
  • The short circuit mechanism needs to know know about deleted docs, but it doesn't and therefor short circuits the has_child query execution too early.
  • The above was amplified when the has_child query was wrapped into a filtered query.

Relates to #4297 and #4210.

@ghost ghost assigned martijnvg Nov 30, 2013
martijnvg added a commit that referenced this issue Nov 30, 2013
* Removed the applyAcceptedDocs in ChildrenConstantScoreQuery, they need to be applied at all times. (because of short circuit mechanism)
* Moved ParentDocSet to FilteredDocIdSetIterator, because it fits better than MatchDocIdSet.
* Made similar changes to ParentConstantScoreQuery for consistency between the two queries. The bug accepted docs bug didn't occur in the ParentConstantScoreQuery.

Closes #4306
martijnvg added a commit that referenced this issue Dec 1, 2013
…docs. In certain scenarios the live docs isn't passed down with acceptedDocs.

For example when a has_child is wrapped in a filtered query as query and the wrapped filter is cached.
The short circuit mechanism in that case counts down based on deleted docs, which then yields lower results than is expected.

Relates to #4306
martijnvg added a commit that referenced this issue Dec 1, 2013
…docs. In certain scenarios the live docs isn't passed down with acceptedDocs.

For example when a has_child is wrapped in a filtered query as query and the wrapped filter is cached.
The short circuit mechanism in that case counts down based on deleted docs, which then yields lower results than is expected.

Relates to #4306
mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
* Removed the applyAcceptedDocs in ChildrenConstantScoreQuery, they need to be applied at all times. (because of short circuit mechanism)
* Moved ParentDocSet to FilteredDocIdSetIterator, because it fits better than MatchDocIdSet.
* Made similar changes to ParentConstantScoreQuery for consistency between the two queries. The bug accepted docs bug didn't occur in the ParentConstantScoreQuery.

Closes elastic#4306
mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
…docs. In certain scenarios the live docs isn't passed down with acceptedDocs.

For example when a has_child is wrapped in a filtered query as query and the wrapped filter is cached.
The short circuit mechanism in that case counts down based on deleted docs, which then yields lower results than is expected.

Relates to elastic#4306
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant