Skip to content

Optionally allow text similarity reranking to fail#121784

Merged
thecoop merged 29 commits intoelastic:mainfrom
thecoop:lenient-rerankers
Feb 17, 2025
Merged

Optionally allow text similarity reranking to fail#121784
thecoop merged 29 commits intoelastic:mainfrom
thecoop:lenient-rerankers

Conversation

@thecoop
Copy link
Member

@thecoop thecoop commented Feb 5, 2025

First part of #116796

Add a allow_reranker_failures option to reranker configuration, allowing errors to be ignored and the search to carry on. The option will be documented as part of the second stage PR

@elasticsearchmachine
Copy link
Collaborator

Hi @thecoop, I've created a changelog YAML for you.

RankFeaturePhaseRankCoordinatorContext rankFeaturePhaseRankCoordinatorContext,
SearchPhaseController.ReducedQueryPhase reducedQueryPhase
) {
RankFeatureDoc[] docs = rankPhaseResults.getSuccessfulResults()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes the thread this happens in - not sure if this matters or not?

@thecoop thecoop added :Search Relevance/Ranking Scoring, rescoring, rank evaluation. and removed :Search Relevance/Search Catch all for Search Relevance labels Feb 5, 2025
@thecoop thecoop marked this pull request as ready for review February 6, 2025 16:19
@elasticsearchmachine elasticsearchmachine added the Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch label Feb 6, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@thecoop thecoop changed the title Add a lenient option to text similarity reranking Feb 7, 2025
@thecoop thecoop requested a review from benwtrent February 7, 2025 08:38
Copy link
Contributor

@pmpailis pmpailis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @thecoop , really nice :) Left some minor comments, with the error handling/logging pending, as well as how to propagate to the user that the results are not reranked (prob something in CompoundRetrieverBuilder ? )

License.OperationMode.ENTERPRISE
);

static final ConstructingObjectParser<TextSimilarityRankBuilder, Void> PARSER = new ConstructingObjectParser<>(NAME, args -> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 on the cleanup :)

context.onPhaseFailure(NAME, "Computing updated ranks for results failed", e);
if (rankFeaturePhaseRankCoordinatorContext.failuresAllowed()) {
// TODO: handle the exception somewhere
// don't want to log the entire stack trace, it's not helpful here
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++

@thecoop thecoop requested a review from pmpailis February 10, 2025 13:02
@pmpailis
Copy link
Contributor

Thanks for all the work and the iterations so far @thecoop ! Will documentation and propagating the non-reranked flag to the user be part of a second PR or will you append them on this one?

@thecoop
Copy link
Member Author

thecoop commented Feb 12, 2025

Yes, they'll be in a second PR to add the user-visible sections

Copy link
Contributor

@pmpailis pmpailis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @thecoop ! Really nice ❤️ Left a couple of minor comments but no need for another review round :)

@thecoop thecoop merged commit fc2f8fc into elastic:main Feb 17, 2025
17 checks passed
@thecoop thecoop deleted the lenient-rerankers branch February 17, 2025 13:32
size: 10

---
"Text similarity reranking with allowed failure maintains custom sorting":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need cluster features here, for BWC?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, the new option can only be used on new nodes, and new functionality is only usable when all nodes have been upgraded to support it. This is only adding functionality, there's no change to existing behaviour here.

thecoop added a commit to thecoop/elasticsearch that referenced this pull request May 21, 2025
Add an option to allow reranking to fail, and the docs to pass through as-is.
Exposing the error to users and adding documentation is a later piece of work.
thecoop added a commit that referenced this pull request May 21, 2025
@Danouchka
Copy link

Hello, when this will be released please ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>enhancement :Search Relevance/Ranking Scoring, rescoring, rank evaluation. Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch v9.1.0

6 participants