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

Optionally allow text similarity reranking to fail #121784

Merged
merged 29 commits into from
Feb 17, 2025

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.

@@ -181,6 +182,11 @@ private void onPhaseDone(
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 Optionally allow text similarity reranking to fail Feb 7, 2025
@thecoop thecoop requested a review from benwtrent February 7, 2025 08:38
@elasticsearchmachine
Copy link
Collaborator

Hi @thecoop, I've updated the changelog YAML for you.

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 ? )

@@ -51,35 +43,26 @@ public class TextSimilarityRankBuilder extends RankBuilder {
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
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants