Skip to content

Commit 7b4d424

Browse files
committed
Remove test that can't be done here - needs to be unit test
1 parent 9fb403b commit 7b4d424

File tree

1 file changed

+0
-57
lines changed

1 file changed

+0
-57
lines changed

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

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -629,63 +629,6 @@ public void testDenseVectorIndexOptionValidation() throws IOException {
629629
}
630630
}
631631

632-
public void testDenseVectorIndexOptions() throws IOException {
633-
for (int depth = 1; depth < 5; depth++) {
634-
String fieldName = randomFieldName(depth);
635-
636-
// We create a specific model that will be compatible with as many types as possible.
637-
Model model = new TestModel(
638-
randomAlphaOfLength(4),
639-
TaskType.TEXT_EMBEDDING,
640-
randomAlphaOfLength(10),
641-
new TestModel.TestServiceSettings(
642-
randomAlphaOfLength(4),
643-
256,
644-
SimilarityMeasure.COSINE,
645-
DenseVectorFieldMapper.ElementType.FLOAT
646-
),
647-
new TestModel.TestTaskSettings(randomInt(3)),
648-
new TestModel.TestSecretSettings(randomAlphaOfLength(4))
649-
);
650-
String inferenceId = model.getInferenceEntityId();
651-
652-
DenseVectorFieldMapper.DenseVectorIndexOptions expectedIndexOptions = DenseVectorFieldTypeTests.randomIndexOptionsAll();
653-
MapperService mapperService = createMapperService(mapping(b -> {
654-
b.startObject(fieldName);
655-
b.field("type", SemanticTextFieldMapper.CONTENT_TYPE);
656-
b.field(INFERENCE_ID_FIELD, inferenceId);
657-
b.startObject(INDEX_OPTIONS_FIELD);
658-
b.field("dense_vector");
659-
expectedIndexOptions.toXContent(b, null);
660-
b.endObject();
661-
b.endObject();
662-
}), useLegacyFormat);
663-
assertSemanticTextField(mapperService, fieldName, false, null, null);
664-
665-
// Verify we can successfully create a document without throwing
666-
DocumentMapper documentMapper = mapperService.documentMapper();
667-
documentMapper.parse(
668-
source(
669-
b -> addSemanticTextInferenceResults(
670-
useLegacyFormat,
671-
b,
672-
List.of(
673-
randomSemanticText(
674-
useLegacyFormat,
675-
fieldName,
676-
model,
677-
null,
678-
null,
679-
List.of("puggles", "chiweenies"),
680-
XContentType.JSON
681-
)
682-
)
683-
)
684-
)
685-
);
686-
}
687-
}
688-
689632
public void testUpdateSearchInferenceId() throws IOException {
690633
final String inferenceId = "test_inference_id";
691634
final String searchInferenceId1 = "test_search_inference_id_1";

0 commit comments

Comments
 (0)