From f5abce76066ce2cb211da9645ee7f479653965b9 Mon Sep 17 00:00:00 2001 From: Max Hniebergall <137079448+maxhniebergall@users.noreply.github.com> Date: Thu, 9 Jan 2025 10:29:59 -0500 Subject: [PATCH] [Inference API] Fix bug checking for e5 or reranker default IDs (#119797) (#119851) * Fix bug checking for non-elser defaults * Update docs/changelog/119797.yaml * fix typo Co-authored-by: Felix Barnsteiner --- docs/changelog/119797.yaml | 5 +++++ .../services/elasticsearch/ElasticsearchInternalService.java | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 docs/changelog/119797.yaml diff --git a/docs/changelog/119797.yaml b/docs/changelog/119797.yaml new file mode 100644 index 0000000000000..992c2078e0caa --- /dev/null +++ b/docs/changelog/119797.yaml @@ -0,0 +1,5 @@ +pr: 119797 +summary: "[Inference API] Fix bug checking for e5 or reranker default IDs" +area: Machine Learning +type: bug +issues: [] diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticsearchInternalService.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticsearchInternalService.java index 25e8fc14da491..54f77b425ff13 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticsearchInternalService.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticsearchInternalService.java @@ -138,7 +138,7 @@ public void parseRequestConfig( Map config, ActionListener modelListener ) { - if (inferenceEntityId.equals(DEFAULT_ELSER_ID)) { + if (isDefaultId(inferenceEntityId)) { modelListener.onFailure( new ElasticsearchStatusException( "[{}] is a reserved inference Id. Cannot create a new inference endpoint with a reserved Id",