Skip to content

Commit d822bab

Browse files
committed
fix tests; remove old code
1 parent 8887d20 commit d822bab

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,10 @@ private void validateIndexOptions(SemanticTextIndexOptions indexOptions, String
455455
return;
456456
}
457457

458+
if (indexOptions.type() == SemanticTextIndexOptions.SupportedIndexOptions.SPARSE_VECTOR && modelSettings == null) {
459+
return;
460+
}
461+
458462
if (modelSettings == null) {
459463
throw new IllegalArgumentException(
460464
"Model settings must be set to validate index options for inference ID [" + inferenceId + "]"

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

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -198,19 +198,6 @@ private static void validateIndexVersion(IndexVersion indexVersion, boolean useL
198198
}
199199
}
200200

201-
/*
202-
private MapperService createMapperService(String mappings, boolean useLegacyFormat) throws IOException {
203-
var settings = Settings.builder()
204-
.put(
205-
IndexMetadata.SETTING_INDEX_VERSION_CREATED.getKey(),
206-
SemanticInferenceMetadataFieldsMapperTests.getRandomCompatibleIndexVersion(useLegacyFormat)
207-
)
208-
.put(InferenceMetadataFieldsMapper.USE_LEGACY_SEMANTIC_TEXT_FORMAT.getKey(), useLegacyFormat)
209-
.build();
210-
return createMapperService(settings, mappings);
211-
}
212-
*/
213-
214201
@Override
215202
protected Settings getIndexSettings() {
216203
return Settings.builder()

0 commit comments

Comments
 (0)