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

Ability to use rescore with Inner hits #108163

Open
benwtrent opened this issue May 1, 2024 · 3 comments
Open

Ability to use rescore with Inner hits #108163

benwtrent opened this issue May 1, 2024 · 3 comments
Labels
>enhancement :Search/Ranking Scoring, rescoring, rank evaluation. :Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team

Comments

@benwtrent
Copy link
Member

Description

For nested queries, and more recently, collapse, its possible to have a top-level rescore that applies to the top-level documents.

However, the inner-hit scores may not reflect the top-level rescore.

It would be beneficial to add rescore to inner_hits so that individual inner hits can be rescored to reflect their top-level score.

The question becomes an API level one.

A: Do we want to simply add a rescore element that is a fully-feature rescore, just like the rescore field in _searcu?

B: Or do we add an option for inner_hits to take advantage of the already existing top-level rescore, but allow them to set override options like window_size?

@jimczi what do you think?

@benwtrent benwtrent added >enhancement :Search/Search Search-related issues that do not fall into other categories :Search/Ranking Scoring, rescoring, rank evaluation. labels May 1, 2024
@elasticsearchmachine elasticsearchmachine added the Team:Search Meta label for search team label May 1, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search (Team:Search)

@jimczi
Copy link
Contributor

jimczi commented May 2, 2024

My preference goes to option A. Rescorers can be cascaded so a single window_size would be confusing. Option A would also be aligned with the fact that inner_hits build a complete search request. For instance the sort option is already exposed so applying the rescorer of the main search request might not be always compatible.
We also need to be careful since inner_hits is a concept shared with the nested query so we need to decide whether the new section would be applicable there.

@benwtrent
Copy link
Member Author

@jimczi I agree, option A is my preferred one as well.

We also need to be careful since inner_hits is a concept shared with the nested query so we need to decide whether the new section would be applicable there.

I think using it in nested makes sense to me actually. Folks can use rescore & nested just fine, and it could be useful for more extreme cases (even with passage vector search, doing a passage vector rerank per doc with a script or model).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :Search/Ranking Scoring, rescoring, rank evaluation. :Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team
Projects
None yet
Development

No branches or pull requests

3 participants