SOLR-17319 : Combined Query Feature for Multi Query Execution#3418
SOLR-17319 : Combined Query Feature for Multi Query Execution#3418dsmiley merged 69 commits intoapache:mainfrom
Conversation
solr/core/src/java/org/apache/solr/handler/component/CombinedQueryComponent.java
Outdated
Show resolved
Hide resolved
solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
Outdated
Show resolved
Hide resolved
solr/core/src/java/org/apache/solr/handler/component/CombinedQueryComponent.java
Show resolved
Hide resolved
|
@alessandrobenedetti @dsmiley, please help review it whenever you can. Thanks! |
solr/core/src/java/org/apache/solr/handler/component/CombinedQueryComponent.java
Outdated
Show resolved
Hide resolved
solr/core/src/java/org/apache/solr/handler/component/CombinedQueryComponent.java
Show resolved
Hide resolved
solr/core/src/java/org/apache/solr/handler/component/CombinedQueryComponent.java
Show resolved
Hide resolved
solr/core/src/java/org/apache/solr/handler/component/CombinedQueryComponent.java
Outdated
Show resolved
Hide resolved
solr/core/src/java/org/apache/solr/handler/component/combine/ReciprocalRankFusion.java
Show resolved
Hide resolved
solr/core/src/java/org/apache/solr/search/combine/QueryAndResponseCombiner.java
Outdated
Show resolved
Hide resolved
solr/core/src/java/org/apache/solr/search/combine/QueryAndResponseCombiner.java
Outdated
Show resolved
Hide resolved
solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java
Outdated
Show resolved
Hide resolved
solr/core/src/test/org/apache/solr/handler/component/CombinedQueryComponentTest.java
Outdated
Show resolved
Hide resolved
solr/core/src/test/org/apache/solr/handler/component/CombinedQueryComponentTest.java
Show resolved
Hide resolved
solr/core/src/java/org/apache/solr/search/combine/ReciprocalRankFusion.java
Outdated
Show resolved
Hide resolved
solr/core/src/java/org/apache/solr/search/combine/ReciprocalRankFusion.java
Outdated
Show resolved
Hide resolved
solr/core/src/java/org/apache/solr/search/combine/ReciprocalRankFusion.java
Outdated
Show resolved
Hide resolved
solr/core/src/java/org/apache/solr/search/combine/ReciprocalRankFusion.java
Outdated
Show resolved
Hide resolved
dsmiley
left a comment
There was a problem hiding this comment.
Really glad to see this work began by acknowledging the existing work and trying to address the pitfalls!
solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
Outdated
Show resolved
Hide resolved
solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java
Outdated
Show resolved
Hide resolved
solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
Outdated
Show resolved
Hide resolved
solr/core/src/java/org/apache/solr/search/combine/QueryAndResponseCombiner.java
Outdated
Show resolved
Hide resolved
|
Hi @ercsonusharma , thanks for resurrecting this, didn't have time to dedicate to the feature in the last few months, good to see some movement! In the next couple of weeks, I should be able to give it a go and review it! |
solr/core/src/java/org/apache/solr/handler/component/CombinedQuerySearchHandler.java
Outdated
Show resolved
Hide resolved
solr/core/src/java/org/apache/solr/handler/component/CombinedQueryComponent.java
Outdated
Show resolved
Hide resolved
solr/core/src/java/org/apache/solr/handler/component/CombinedQueryComponent.java
Outdated
Show resolved
Hide resolved
dsmiley
left a comment
There was a problem hiding this comment.
Thank you for the test; I like it!
I've been neglecting your PR (and of others that are non-trivial), with my attention on critical 10.0 backwards compatibility changes. But I should be getting to this...
| * This contains the classes to combine the scores from search index results. Multiple | ||
| * implementation of algorithms can be added to support them. | ||
| */ | ||
| package org.apache.solr.handler.component.combine; |
There was a problem hiding this comment.
I was thinking the CombinedQuery* classes would come here too, thus all classes associated with this are together. WDYT?
There was a problem hiding this comment.
The original intention was to group the *Handler and *Component classes within the same package, as done previously.
It will affect this where we might deviate from usual convention of having solr.<ComponentName> & solr.<HandlerName>
|
BTW I'm busy tweaking some things and preparing a ~final state that's mergeable. |
Refactor SearchHandler to be more extensible and have a clearer flow. Improve BaseDistributedSearchTestCase.query to not set "distrib" on the control client request.
|
Please take a look Sonu. I also refactored SearchHandler a bit to have a clearer flow / readability and also extensibility. I'd like to merge the refactoring portions of this PR in one go, then the rest of this here. Like... I could extract all that to be under SOLR-17982. A TODO I didn't get to tonight is testing the different forceDistrib API with a custom SearchHandler subclass. Both testForceDistrib methods are there but need to be modified. I suspect shards.info may reflect what we want to see. |
solr/core/src/java/org/apache/solr/handler/component/CombinedQuerySearchHandler.java
Show resolved
Hide resolved
|
Thanks for all the changes! So, the change would limit, having a new component only can't enable force-distributed behaviour on the existing SearchHandler.
Sounds good to me. I am still not sure if shardinfo reflects on the |
|
@dsmiley - Thanks for the PR! It looks good on my end. What do you think the next step should be, considering the other PR has been open for quite a few days now? |
|
#3931 should merge first (say in ~2 days), then this one will be simpler and it's ready to go. I expect I should merge this one by the end of next week.. |
dsmiley
left a comment
There was a problem hiding this comment.
Sonu, can you please update this from main? It will simplify this PR a good deal. It should be ready for me to merge Friday, which I'm saying to give anyone else a moment to look before merging.
|
Sounds good, Thank you @dsmiley - done with update from main. I would appreciate it if you could trigger the workflows in the meantime. |
|
Workflow failures seem likely to be infrastructure-related and a flaky SolrCloud test case. Re-triggering the workflow may help it pass. |
|
@dsmiley - I see it failed again after re-triggering the same workflows. Luckily, I found a tiny cleanup to commit. Can you help approve the workflow? After the latest run: all passed except "Solr Tests using Crave" which is struggling to find disk space. |
New CombinedQuerySearchHandler etc. for implementing hybrid search with reciprocal rank fusion (RRF). See "JSON Combined Query DSL" in ref guide, and params prefixed with "combiner". QueryComponent: refactorings to enable a subclass to customize merging shard results. --------- Co-authored-by: Sonu Sharma <sonu_sharma2@apple.com> Co-authored-by: Christine Poerschke <cpoerschke@apache.org> Co-authored-by: David Smiley <dsmiley@apache.org>
New CombinedQuerySearchHandler etc. for implementing hybrid search with reciprocal rank fusion (RRF). See "JSON Combined Query DSL" in ref guide, and params prefixed with "combiner". QueryComponent: refactorings to enable a subclass to customize merging shard results. --------- Co-authored-by: Sonu Sharma <sonu_sharma2@apple.com> Co-authored-by: Christine Poerschke <cpoerschke@apache.org> Co-authored-by: David Smiley <dsmiley@apache.org> (cherry picked from commit 42cd889)
https://issues.apache.org/jira/browse/SOLR-17319
Description
This feature aims to execute multiple queries of multiple kinds across multiple shards of a collection and combine their result basis an algorithm (like Reciprocal Rank Fusion). It also help resolve the issues being discussed w.r.t the previous PR, mainly around across shard documents merging. It provides more flexibility in terms of querying extending JSON Query DSL ultimately enabling Hybrid Search in a pure way solving the shortcomings.
Note: This feature is currently unsupported for non-distributed and grouping query.
Solution
Tests
Checklist
Please review the following and check all that apply:
mainbranch../gradlew check.