-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[RFC] Opening an Interface Carring SearchContext and Query for Pre-Execution between QueryBuilder and QueryPhaseSearcher #13320
Comments
Hey @conggguan thanks for opening the issue. I definitely agree the 1 Like you mentioned, there are cases such as the I think the high level idea of having some sort of |
@conggguan I read through the related issue opensearch-project/neural-search#646 and from that it looks like you are exploring the search pipelines approach instead, does that mean you do not need this functionality? Regardless it would be nice to hear if you have any thoughts on how to compose the |
Hi @jed326 And for your concerns of how to compose the different preprocess of plugins, I gave it some thought and came up with the following possibilities. PreProcess LevelWe can manage and prioritize different action by different level.
Consider the compatibility, I think can use a similar way, gradually open up some interfaces for developers to use. |
Thanks @conggguan. I'm also working on a feature (RFC to be published soon) where we need to modify the OpenSearch/server/src/main/java/org/opensearch/action/support/ActionFilter.java Lines 47 to 50 in aca2e9d
But aside from that I think one of the big problems still is that the current |
Description
This RFC is related opensearch-project/neural-search#646.
Intro
Briefly, we want enhance the performance, divide a neuralSparseQuery to a less computationally expensive query and a more expensive query, we use the former to get a TopDocs firstly, and then use the more computationally expensive query as a rescoreQuery to adjust the score of the results.
limitation
There have lots of entry point to process the query, such as doRewrite(QueryRewriteContext queryShardContext), doToQuery(QueryShardContext queryShardContext). But each of them have no access to searchContext and whole query information. When we build a new feature which needs considering the global compound query information. Beside NeuralSparseQuery, HybridQuery also needs a interface carrying searchContext and whole query.
Existing compromise solution
The current solution is that register a QueryPhaseSearcher by the interface of SearchPlugin. So that we can get a searchWith entry point, all of query will reach this function and with searchContext, in this function, we can do what we want to do of searchContext and query.
pain point
Describe the solution you'd like
Open a plugin preProcess API that can do some custom progress before QueryPhaseSearcher.searchWith.
Design draft
Earlier AggregationProcessor
In QueryPhaseSearcher, we can Override aggregationProcessor() interface to add a preProcess or postProcess. We can do a similar but earlier interface in QueryPhase.
A TwoPhaseScorer
There is a class named TwoPhaseIterator, but indeed, it's two phase means there has two phases to determine the next iterate's step.
Build a Scorer that can use score result of first loop and do a second score process. It will make's more easy to do some job about multi-stage query.
open the access of searchContext in QueryBuilder's doToQuery() and add a proProcess interface for searchContext
We can register some proProcess lambda function of this funciton.
Related component
QueryPhaseSearcher, SearchPlugin
The text was updated successfully, but these errors were encountered: