-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Handle total hits equal to track_total_hits #37907
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
Conversation
This change ensures that a total hits equal to the value set for track_total_hits is not considered as a lower bound. Closes elastic#37897
|
Pinging @elastic/es-search |
jpountz
left a comment
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.
We might still return gte in case of exact match if there is a single shard that has matches since Lucene sets the relation as gte as soon as the number of matches is greater than or equal to the threshold: https://github.com/apache/lucene-solr/blob/947f82679afa6d984c246b686d0133085982c376/lucene/core/src/java/org/apache/lucene/search/TopScoreDocCollector.java#L75
So I think we either need to change the behavior in Lucene as well or change expectations on our side?
|
We discussed with @jpountz offline and agreed that the behavior in Lucene is not intuitive (return a lower bound when the doc count is equal to the threshold). I opened https://issues.apache.org/jira/browse/LUCENE-8660 to change the heuristic to count accurately up to the threshold instead of threshold-1. |
jpountz
left a comment
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.
LGTM
This change ensures that a total hits equal to the value set for track_total_hits is not considered as a lower bound.
This change ensures that a total hits equal to the value set for track_total_hits is not considered as a lower bound.
This change ensures that a total hits equal to the value set for
track_total_hits is not considered as a lower bound.
Closes #37897