From 2d08e60692620f1aa89773d9d676b15bc900335e Mon Sep 17 00:00:00 2001 From: Mridula Date: Wed, 29 Oct 2025 10:53:07 +0000 Subject: [PATCH 1/6] Cleaned up the old constant --- .../xpack/inference/mapper/SemanticTextFieldMapper.java | 6 +----- .../inference/mapper/SemanticTextFieldMapperTests.java | 7 +++---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/mapper/SemanticTextFieldMapper.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/mapper/SemanticTextFieldMapper.java index 95294ef28c148..109646cf0e827 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/mapper/SemanticTextFieldMapper.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/mapper/SemanticTextFieldMapper.java @@ -156,11 +156,7 @@ public class SemanticTextFieldMapper extends FieldMapper implements InferenceFie public static final String CONTENT_TYPE = "semantic_text"; public static final String DEFAULT_FALLBACK_ELSER_INFERENCE_ID = DEFAULT_ELSER_ID; public static final String DEFAULT_EIS_ELSER_INFERENCE_ID = DEFAULT_ELSER_ENDPOINT_ID_V2; - /** - * @deprecated Replaced by {@link #DEFAULT_EIS_ELSER_INFERENCE_ID}. - */ - @Deprecated(since = "9.3.0", forRemoval = false) - public static final String DEFAULT_ELSER_2_INFERENCE_ID = DEFAULT_EIS_ELSER_INFERENCE_ID; + public static final String UNSUPPORTED_INDEX_MESSAGE = "[" + CONTENT_TYPE + "] is available on indices created with 8.11 or higher. Please create a new index to use [" diff --git a/x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/mapper/SemanticTextFieldMapperTests.java b/x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/mapper/SemanticTextFieldMapperTests.java index 8af504456fbec..10dacc42400cf 100644 --- a/x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/mapper/SemanticTextFieldMapperTests.java +++ b/x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/mapper/SemanticTextFieldMapperTests.java @@ -115,7 +115,6 @@ import static org.elasticsearch.xpack.inference.mapper.SemanticTextField.getChunksFieldName; import static org.elasticsearch.xpack.inference.mapper.SemanticTextField.getEmbeddingsFieldName; import static org.elasticsearch.xpack.inference.mapper.SemanticTextFieldMapper.DEFAULT_EIS_ELSER_INFERENCE_ID; -import static org.elasticsearch.xpack.inference.mapper.SemanticTextFieldMapper.DEFAULT_ELSER_2_INFERENCE_ID; import static org.elasticsearch.xpack.inference.mapper.SemanticTextFieldMapper.DEFAULT_FALLBACK_ELSER_INFERENCE_ID; import static org.elasticsearch.xpack.inference.mapper.SemanticTextFieldMapper.DEFAULT_RESCORE_OVERSAMPLE; import static org.elasticsearch.xpack.inference.mapper.SemanticTextFieldMapper.INDEX_OPTIONS_FIELD; @@ -686,10 +685,10 @@ public void testUpdateInferenceId_GivenCurrentHasSparseModelSettingsAndNewSetsDe assertSemanticTextField(mapperService, fieldName, true, null, null); MinimalServiceSettings newModelSettings = MinimalServiceSettings.sparseEmbedding("new_service"); - givenModelSettings(DEFAULT_ELSER_2_INFERENCE_ID, newModelSettings); + givenModelSettings(DEFAULT_EIS_ELSER_INFERENCE_ID, newModelSettings); merge(mapperService, mapping(b -> b.startObject(fieldName).field("type", "semantic_text").endObject())); - assertInferenceEndpoints(mapperService, fieldName, DEFAULT_ELSER_2_INFERENCE_ID, DEFAULT_ELSER_2_INFERENCE_ID); + assertInferenceEndpoints(mapperService, fieldName, DEFAULT_EIS_ELSER_INFERENCE_ID, DEFAULT_EIS_ELSER_INFERENCE_ID); assertSemanticTextField(mapperService, fieldName, true, null, null); SemanticTextFieldMapper semanticFieldMapper = getSemanticFieldMapper(mapperService, fieldName); assertThat(semanticFieldMapper.fieldType().getModelSettings(), equalTo(newModelSettings)); @@ -866,7 +865,7 @@ public void testUpdateInferenceId_CurrentHasDenseModelSettingsAndNewSetsDefault_ assertSemanticTextField(mapperService, fieldName, true, null, null); MinimalServiceSettings newModelSettings = MinimalServiceSettings.sparseEmbedding("new_service"); - givenModelSettings(DEFAULT_ELSER_2_INFERENCE_ID, newModelSettings); + givenModelSettings(DEFAULT_EIS_ELSER_INFERENCE_ID, newModelSettings); Exception exc = expectThrows( IllegalArgumentException.class, From b4d98ac0386f90b4f921638843daf3166ac63cb6 Mon Sep 17 00:00:00 2001 From: Mridula Date: Wed, 29 Oct 2025 11:00:17 +0000 Subject: [PATCH 2/6] Cleaned up test --- .../xpack/inference/mapper/SemanticTextFieldMapperTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/mapper/SemanticTextFieldMapperTests.java b/x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/mapper/SemanticTextFieldMapperTests.java index 10dacc42400cf..273a202baa7d6 100644 --- a/x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/mapper/SemanticTextFieldMapperTests.java +++ b/x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/mapper/SemanticTextFieldMapperTests.java @@ -882,7 +882,7 @@ public void testUpdateInferenceId_CurrentHasDenseModelSettingsAndNewSetsDefault_ + "] with model settings [" + previousModelSettings + "] is not compatible with new inference endpoint [" - + DEFAULT_ELSER_2_INFERENCE_ID + + DEFAULT_EIS_ELSER_INFERENCE_ID + "] with model settings [" + newModelSettings + "]" From 45998422e5615d03307561c3b008173f664a2e7f Mon Sep 17 00:00:00 2001 From: Mridula Date: Wed, 29 Oct 2025 11:11:05 +0000 Subject: [PATCH 3/6] Update docs/changelog/137329.yaml --- docs/changelog/137329.yaml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 docs/changelog/137329.yaml diff --git a/docs/changelog/137329.yaml b/docs/changelog/137329.yaml new file mode 100644 index 0000000000000..67e84c8bf7817 --- /dev/null +++ b/docs/changelog/137329.yaml @@ -0,0 +1,5 @@ +pr: 137329 +summary: Followup default EIS fix +area: Relevance +type: bug +issues: [] From 40b6627acbb475493ee34e0e841cd43fdb8971ec Mon Sep 17 00:00:00 2001 From: Mridula Date: Wed, 29 Oct 2025 11:18:52 +0000 Subject: [PATCH 4/6] Update docs/changelog/137329.yaml --- docs/changelog/137329.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog/137329.yaml b/docs/changelog/137329.yaml index 67e84c8bf7817..6649d2c3ea723 100644 --- a/docs/changelog/137329.yaml +++ b/docs/changelog/137329.yaml @@ -1,5 +1,5 @@ pr: 137329 summary: Followup default EIS fix area: Relevance -type: bug +type: tech debt issues: [] From 4970a2cd4966b1d3a54c0fd2467c17bc929aac59 Mon Sep 17 00:00:00 2001 From: Mridula Date: Wed, 29 Oct 2025 11:27:40 +0000 Subject: [PATCH 5/6] Update docs/changelog/137329.yaml --- docs/changelog/137329.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog/137329.yaml b/docs/changelog/137329.yaml index 6649d2c3ea723..67e84c8bf7817 100644 --- a/docs/changelog/137329.yaml +++ b/docs/changelog/137329.yaml @@ -1,5 +1,5 @@ pr: 137329 summary: Followup default EIS fix area: Relevance -type: tech debt +type: bug issues: [] From 99835d096d2502240cc8e94313d08a6c4c4b9394 Mon Sep 17 00:00:00 2001 From: Mridula Date: Wed, 29 Oct 2025 12:58:59 +0000 Subject: [PATCH 6/6] Delete docs/changelog/137329.yaml --- docs/changelog/137329.yaml | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 docs/changelog/137329.yaml diff --git a/docs/changelog/137329.yaml b/docs/changelog/137329.yaml deleted file mode 100644 index 67e84c8bf7817..0000000000000 --- a/docs/changelog/137329.yaml +++ /dev/null @@ -1,5 +0,0 @@ -pr: 137329 -summary: Followup default EIS fix -area: Relevance -type: bug -issues: []