-
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
[Feature Request] Allow override individual sub phase of Fetch phase #14546
Comments
Thanks for opening the issue @martin-gaievski!
To clarify, you are able to provide your own sub-phase logic today with the existing As for your described solutions, I have similar concerns about the ordering approach, and beyond what you described in general I think what you are trying to achieve with ordering will make it so that each sub-phase will have to do a lot of type checking since it's functionality is actually tightly coupled with the order. For your first solution, I'm also a little concerned about if it truly makes sense for a plugin to be able to override some of the other fetch subphases. For example why would we want to allow the Given that it actually seems like you have a fairly narrow use case here, have you thought about if it would make sense to add an extension point into the InnerHitsPhase class itself instead of to all fetch sub phases? Admittedly I haven't looked to far into the implementation, but for example I see that the |
@jed326 I have a use case where the logic in InnerHits phase needs customization. In particular the main logic on getting hits and fetching their source works fine, what needs to be changed is the scores. Multiple processors in semantic search actually change scores (rerank, normalization), but if inner_hits are requested by user then scores for those inner hits will not be processed as per logic of those processors, which creates inconsistency in results. At the glance this approach with customized providers for the InnerHits phase looks easier than generic mechanism of overriding the whole fetch sub-phase. Logic probably should be more sophisticated comparing to highlighters, mainly because we don't need to simple append results, but to override elements of results by providing custom values or set them empty. |
Is your feature request related to a problem? Please describe
Currently there is no way of customizing results of individual sub-phase of fetch phase. If I need to skip adding one sub-phase results or provide my own sub-phase that does some specific logic instead of existing sub-phase it's not possible.
Describe the solution you'd like
Ideally I need one of following:
Second approach has a drawback - if newly registered sub-phase does the job similar to one of existing phases then system will do double job and one from existing core sub-phases will be thrown away work.
For the context - when talking about new fetch sub-phase I mean existing extension point in SearchPlugin interface.
Related component
Search
Describe alternatives you've considered
There is no alternative as such
Additional context
Example of use case where this functionality is needed - we want to manipulate with results of
inner_hits
feature of the query. Today is no possible because InnerFetchPhase is always added and executed last after all other sub-phases (as per this code in FetchPhase)The text was updated successfully, but these errors were encountered: