Skip to content

Commit d07a003

Browse files
authored
Remove deprecated constant for default elser inference id (#137329)
* Cleaned up the old constant * Cleaned up test * Update docs/changelog/137329.yaml * Update docs/changelog/137329.yaml * Update docs/changelog/137329.yaml * Delete docs/changelog/137329.yaml
1 parent 22fe5be commit d07a003

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/mapper/SemanticTextFieldMapper.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,7 @@ public class SemanticTextFieldMapper extends FieldMapper implements InferenceFie
156156
public static final String CONTENT_TYPE = "semantic_text";
157157
public static final String DEFAULT_FALLBACK_ELSER_INFERENCE_ID = DEFAULT_ELSER_ID;
158158
public static final String DEFAULT_EIS_ELSER_INFERENCE_ID = DEFAULT_ELSER_ENDPOINT_ID_V2;
159-
/**
160-
* @deprecated Replaced by {@link #DEFAULT_EIS_ELSER_INFERENCE_ID}.
161-
*/
162-
@Deprecated(since = "9.3.0", forRemoval = false)
163-
public static final String DEFAULT_ELSER_2_INFERENCE_ID = DEFAULT_EIS_ELSER_INFERENCE_ID;
159+
164160
public static final String UNSUPPORTED_INDEX_MESSAGE = "["
165161
+ CONTENT_TYPE
166162
+ "] is available on indices created with 8.11 or higher. Please create a new index to use ["

x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/mapper/SemanticTextFieldMapperTests.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@
115115
import static org.elasticsearch.xpack.inference.mapper.SemanticTextField.getChunksFieldName;
116116
import static org.elasticsearch.xpack.inference.mapper.SemanticTextField.getEmbeddingsFieldName;
117117
import static org.elasticsearch.xpack.inference.mapper.SemanticTextFieldMapper.DEFAULT_EIS_ELSER_INFERENCE_ID;
118-
import static org.elasticsearch.xpack.inference.mapper.SemanticTextFieldMapper.DEFAULT_ELSER_2_INFERENCE_ID;
119118
import static org.elasticsearch.xpack.inference.mapper.SemanticTextFieldMapper.DEFAULT_FALLBACK_ELSER_INFERENCE_ID;
120119
import static org.elasticsearch.xpack.inference.mapper.SemanticTextFieldMapper.DEFAULT_RESCORE_OVERSAMPLE;
121120
import static org.elasticsearch.xpack.inference.mapper.SemanticTextFieldMapper.INDEX_OPTIONS_FIELD;
@@ -686,10 +685,10 @@ public void testUpdateInferenceId_GivenCurrentHasSparseModelSettingsAndNewSetsDe
686685
assertSemanticTextField(mapperService, fieldName, true, null, null);
687686

688687
MinimalServiceSettings newModelSettings = MinimalServiceSettings.sparseEmbedding("new_service");
689-
givenModelSettings(DEFAULT_ELSER_2_INFERENCE_ID, newModelSettings);
688+
givenModelSettings(DEFAULT_EIS_ELSER_INFERENCE_ID, newModelSettings);
690689
merge(mapperService, mapping(b -> b.startObject(fieldName).field("type", "semantic_text").endObject()));
691690

692-
assertInferenceEndpoints(mapperService, fieldName, DEFAULT_ELSER_2_INFERENCE_ID, DEFAULT_ELSER_2_INFERENCE_ID);
691+
assertInferenceEndpoints(mapperService, fieldName, DEFAULT_EIS_ELSER_INFERENCE_ID, DEFAULT_EIS_ELSER_INFERENCE_ID);
693692
assertSemanticTextField(mapperService, fieldName, true, null, null);
694693
SemanticTextFieldMapper semanticFieldMapper = getSemanticFieldMapper(mapperService, fieldName);
695694
assertThat(semanticFieldMapper.fieldType().getModelSettings(), equalTo(newModelSettings));
@@ -866,7 +865,7 @@ public void testUpdateInferenceId_CurrentHasDenseModelSettingsAndNewSetsDefault_
866865
assertSemanticTextField(mapperService, fieldName, true, null, null);
867866

868867
MinimalServiceSettings newModelSettings = MinimalServiceSettings.sparseEmbedding("new_service");
869-
givenModelSettings(DEFAULT_ELSER_2_INFERENCE_ID, newModelSettings);
868+
givenModelSettings(DEFAULT_EIS_ELSER_INFERENCE_ID, newModelSettings);
870869

871870
Exception exc = expectThrows(
872871
IllegalArgumentException.class,
@@ -883,7 +882,7 @@ public void testUpdateInferenceId_CurrentHasDenseModelSettingsAndNewSetsDefault_
883882
+ "] with model settings ["
884883
+ previousModelSettings
885884
+ "] is not compatible with new inference endpoint ["
886-
+ DEFAULT_ELSER_2_INFERENCE_ID
885+
+ DEFAULT_EIS_ELSER_INFERENCE_ID
887886
+ "] with model settings ["
888887
+ newModelSettings
889888
+ "]"

0 commit comments

Comments
 (0)