Skip to content

Fix LTR rescorer with model alias #126273

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

Merged
merged 9 commits into from
Apr 11, 2025
Merged

Conversation

afoucret
Copy link
Contributor

@afoucret afoucret commented Apr 4, 2025

This PR fix a bug when using an LTR rescorer with a model alias where the user was seing the following error:

{
  "error": {
    "root_cause": [
      {
        "type": "resource_not_found_exception",
        "reason": "Could not find trained model [my-model-alias]"
      }
    ],
    "type": "resource_not_found_exception",
    "reason": "Could not find trained model [my-model-alias]"
  },
  "status": 404
}

@afoucret afoucret added >bug :Search Relevance/Ranking Scoring, rescoring, rank evaluation. auto-backport Automatically create backport pull requests when merged v8.18.1 v8.19.0 v9.0.1 v9.1.0 v8.17.5 labels Apr 4, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine elasticsearchmachine added the Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch label Apr 4, 2025
@afoucret afoucret requested a review from markjhoy April 4, 2025 09:08
@afoucret afoucret requested a review from a team April 4, 2025 12:08
Copy link
Member

@kderusso kderusso left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -247,8 +247,12 @@ setup:
"learning_to_rank": { "model_id": "ltr-missing" }
}
}
- match: { status: 404 }
- match: { error.root_cause.0.type: "resource_not_found_exception" }
- match: { error.root_cause.0.reason: "Could not find trained model [ltr-missing]" }
Copy link
Member

Choose a reason for hiding this comment

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

Non-blocking tip - you could optimize this with something like catch: /Could not find trained model \[ltr-missing\] if you wanted to.

Copy link
Contributor

@markjhoy markjhoy left a comment

Choose a reason for hiding this comment

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

+1

@afoucret
Copy link
Contributor Author

afoucret commented Apr 9, 2025

The YAML test are flaky in serverless.

@kderusso
Copy link
Member

kderusso commented Apr 9, 2025

The YAML test are flaky in serverless.
Scoring issue maybe?

@afoucret afoucret enabled auto-merge (squash) April 10, 2025 15:08
@afoucret afoucret disabled auto-merge April 10, 2025 15:08
@afoucret afoucret enabled auto-merge (squash) April 10, 2025 15:08
@afoucret afoucret disabled auto-merge April 10, 2025 18:53
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.18
8.x
9.0
8.17

afoucret added a commit to afoucret/elasticsearch that referenced this pull request Apr 11, 2025
afoucret added a commit to afoucret/elasticsearch that referenced this pull request Apr 11, 2025
afoucret added a commit to afoucret/elasticsearch that referenced this pull request Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged >bug :Search Relevance/Ranking Scoring, rescoring, rank evaluation. Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch v8.17.6 v8.18.1 v8.19.0 v9.0.1 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants