SOLR-18271: QueryElevation support for Combined Query feature#4476
Open
ercsonusharma wants to merge 2 commits into
Open
SOLR-18271: QueryElevation support for Combined Query feature#4476ercsonusharma wants to merge 2 commits into
ercsonusharma wants to merge 2 commits into
Conversation
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://issues.apache.org/jira/browse/SOLR-18271
Description
Adds QueryElevationComponent support to the Combined Query feature, so that elevated docIds (via elevateIds / configured elevations) are honored when results from multiple subqueries are combined and merged across shards.
Solution
QueryElevationComponent.prepare now detects when it is operating on a CombinedQueryResponseBuilder and dispatches to a new prepareCombined path. That path runs the existing elevation preparation on each subquery's ResponseBuilder, then mirrors the resulting SortSpec and filters from a representative subquery onto the parent crb. This lets
CombinedQueryComponent#mergeIdsread the_elevate_marker from each shard'ssort_values_iduring distributed merge, preserving elevation order across the combined result set.Supporting changes:
CombinedQueryComponent#preparenow propagates the debug flag(rbNew.setDebug(rb.isDebug()))to subquery response builders so debug info flows through.solrconfig-combined-query.xml(test config) adds a/search-elevatehandler wired with the elevator (QueryElevationComponent) as a last-component, using elevate.xml.Tests
Added two new tests as described below:
CombinedQuerySolrCloudTest#testElevatedQueriesWithFacetAndHighlights- new SolrCloud integration test that issues a combined JSON query with two lexical subqueries plus elevateIds, faceting, and highlighting. Verifies elevated ids appear first in the expected order, and that facet counts and highlight snippets are still correct alongside elevation.DistributedCombinedQueryComponentTest#testElevatedQueriesWithFacetAndHighlights- new distributed test that passes lucene subqueries with elevateIds and debug=true. Verifies elevated order, facets, highlights, and that the merged debug response contains a queryBoosting entry with one element per subquery.Checklist
Please review the following and check all that apply:
mainbranch../gradlew check.