Conversation
…er aggregation pass During multi-retriever search, the aggregation pass (collectors/facets) previously re-executed the full union query from scratch. This change captures doc IDs into per-retriever SparseFixedBitSets during the retriever recall phase and replays them for aggregation via a lightweight cached query — avoiding the expensive re-execution. Protection: each retriever short-circuits at 7k docs (plain int counter, no atomics). If any retriever exceeds the threshold, the cache is invalidated and the aggregation transparently falls back to the union query via MultiRetrieverAggregationQuery.rewrite(). Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
https://jira.yelpcorp.com/browse/RP-16311
https://docs.google.com/document/d/1lvGjNSzzYJ8CHHXb8qxS3yMx-iLQW_qRZK7Z-WHBt-0/edit?tab=t.5443g0bbb9aw#heading=h.u9nrgnw9ioas
Add a new internal MultiRetrieverAggregationQuery backed by a docId cache to record hit docId without scores. Use this query to avoid second-pass for union query during the aggregation.
Under either condition, the query will fallback to the union query during the rewrite: