Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/changelog/137329.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 137329
summary: Followup default EIS fix
area: Relevance
type: bug
issues: []
Original file line number Diff line number Diff line change
Expand Up @@ -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 ["
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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,
Expand All @@ -883,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
+ "]"
Expand Down