Skip to content
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] Add extension point to allow customizations and/or extensions in Rescore processor #16183

Open
martin-gaievski opened this issue Oct 3, 2024 · 0 comments
Labels
enhancement Enhancement or improvement to existing feature or request Search Search query, autocomplete ...etc

Comments

@martin-gaievski
Copy link
Member

Is your feature request related to a problem? Please describe

It's not possible to use existing rescore functionality in scenarios when scores or ranks for search hits are adjusted after the query phase. Either resulting list will be changed (reshuffled) and final result will be irrelevant, or system will be throwing errors/exceptions. Some reasons for such behavior are strong assumption on internal format of query results, and no flexibility for changing when rescore will be called in context of search query lifecycle.

Describe the solution you'd like

Extensible RescoreProcessor, so from the plugin I'm able to provide my own implementation of it. We can have an interface with method public void process(SearchContext context), and class that we have today https://github.com/opensearch-project/OpenSearch/blob/main/server/src/main/java/org/opensearch/search/rescore/RescoreProcessor.java will be a default implementation. But in the plugin we can register more implementations of the same interface for particular query type.

This is different from extensibility that system provides today, with SearchPlugin.getRescorers() method. In that method you register a handler that will handle the rescore query of your custom type. What I want is the customization of the rescore flow for particular query type.

Related component

Search

Describe alternatives you've considered

There is a workaround for this gap: we can return rescore==false fro mthe QueryPhaseSearcher, and call RescoreContext.rescorer().rescore() directly from our code, mimicking implementation of RescoreProcessor.process().

Additional context

One scenario where such flexibility is needed is hybrid query, rescore should not mess the normalized and combined scores and work with specific format of top docs in query results.

@martin-gaievski martin-gaievski added enhancement Enhancement or improvement to existing feature or request untriaged labels Oct 3, 2024
@github-actions github-actions bot added the Search Search query, autocomplete ...etc label Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement or improvement to existing feature or request Search Search query, autocomplete ...etc
Projects
Status: 🆕 New
Development

No branches or pull requests

2 participants