-
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
[BUG] Concurrent Segment Search doesn't work if a Plugin Overrides the QueryPhaseSearcher #9704
Comments
@navneet1v I don't think this is a bug instead it is how the A plugin can extend this or compose it based on the use case. Like plugin can provide a QueryPhaseSearcher, which can keep map of core provided searchers and its own and then based on request state decide which one to use. Or even build this in the core to make that decision. Not sure why it is tied to concurrent search GA. Based on #7020 my understanding was you or @martin-gaievski were doing some PoC for the same ? Based on the code shared here, seems like it needs to extend |
Yes we can change the neural search class to extend the QueryPhaseSearcherWrapper, but still it doesn't solve the problem. What will happen if some other backend plugin comes up and want to implement another query phase searcher. Thing is it cannot happen. Hence I think we should start thinking about this and not come up with these intermediate solutions. Reason why I am tieing this up with Concurrent Search is because we are adding it as a new Feature in OpenSearch Core and it changes the QueryPhaseSearcher. Also, my main point here is the interface provided for extending QueryPhaseSearcher is not an actual extension.
This is similar to the Codec extension point we had earlier in the OpenSearch. We extended that interface to make sure that more than one codec can be be present in OpenSearch. I was thinking we should come up with a similar solution here too. See #1387 and #1404 cc: @nknize |
@navneet1v I didn't say in my last comment that extending the OpenSearch internal implementation is the best way to go. The way it was done currently is as I explained above where it expects depending on the installed plugin to either use plugin provided implementation or use the core ones. Given there are use cases to have multiple composite searchers we should definitely extend it and you can create PR with the change in core which solves the plugin use case in best way.
Concurrent search is changing the
Agreed and I would think when |
@sohami correct, we'd been looking to the implement one specific case, the concurrent search, in a way that does allow injection of different implementations by plugins. @navneet1v what @sohami is saying is certainly one of the options to implement the desired flow: provide your own QueryPhaseSearcher but delegate to the ConcurrentQueryPhaseSearcher / DefaultQueryPhaseSearcher when needed (it is possible now without any changes in core). Also, the However, what we probably need is to have the contextual QueryPhaseSearcher that could complement (or may be even replace) the way
That would allow plugins to register many providers but only one is going to be picked for the context. Obviously, the issue is that since |
Describe the bug
As part of Enabling the Normalization and Score Combination Feature(RFC: opensearch-project/neural-search#126) in OpenSearch via Neural Search plugin, we used the Extension point of QueryPhaseSearcher(https://github.com/opensearch-project/OpenSearch/blob/main/server/src/main/java/org/opensearch/search/SearchModule.java#L1248-L1259), but the problem with that extension point is it enables the Searcher at Cluster Level and not at the Index level. This make the Concurrent Search un-usable because another implementation of QueryPhaseSearcher is there.
So cutting this issue to start a conversation that, the fix needs to be done before Concurrent Segment Search can become GA.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Ideally there should be a way in which Plugins can define when to use their QueryPhaseSearcher at Index level. Also, core needs to make sure that all the QueryPhaseSearcher which are registered are initialized and during runtime based on the index/cluster setting right Searcher is picked up.
Plugins
k-NN, MLCommons, Neural Search.
Screenshots
NA
Host/Environment (please complete the following information):
NA
Additional context
The same issue was raised as a feature request too: #7020
The text was updated successfully, but these errors were encountered: