Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 0 additions & 3 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -568,9 +568,6 @@ tests:
- class: org.elasticsearch.index.mapper.vectors.DenseVectorFieldMapperTests
method: testExistsQueryMinimalMapping
issue: https://github.com/elastic/elasticsearch/issues/129911
- class: org.elasticsearch.index.mapper.DynamicMappingIT
method: testDenseVectorDynamicMapping
issue: https://github.com/elastic/elasticsearch/issues/129928

# Examples:
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -924,15 +924,21 @@ public void testDenseVectorDynamicMapping() throws Exception {
client().index(
new IndexRequest("test").source("vector_bbq", Randomness.get().doubles(BBQ_DIMS_DEFAULT_THRESHOLD, 0.0, 5.0).toArray())
).get();
Map<String, Object> mappings = indicesAdmin().prepareGetMappings(TEST_REQUEST_TIMEOUT, "test")
.get()
.mappings()
.get("test")
.sourceAsMap();
assertTrue(new WriteField("properties.vector_int8", () -> mappings).exists());
assertTrue(new WriteField("properties.vector_int8.index_options.type", () -> mappings).get(null).toString().equals("int8_hnsw"));
assertTrue(new WriteField("properties.vector_bbq", () -> mappings).exists());
assertTrue(new WriteField("properties.vector_bbq.index_options.type", () -> mappings).get(null).toString().equals("bbq_hnsw"));

assertBusy(() -> {
Map<String, Object> mappings = indicesAdmin().prepareGetMappings(TEST_REQUEST_TIMEOUT, "test")
.get()
.mappings()
.get("test")
.sourceAsMap();

assertTrue(new WriteField("properties.vector_int8", () -> mappings).exists());
assertTrue(
new WriteField("properties.vector_int8.index_options.type", () -> mappings).get(null).toString().equals("int8_hnsw")
);
assertTrue(new WriteField("properties.vector_bbq", () -> mappings).exists());
assertTrue(new WriteField("properties.vector_bbq.index_options.type", () -> mappings).get(null).toString().equals("bbq_hnsw"));
});
}

public void testBBQDynamicMappingWhenFirstIngestingDoc() throws Exception {
Expand All @@ -956,12 +962,15 @@ public void testBBQDynamicMappingWhenFirstIngestingDoc() throws Exception {

client().index(new IndexRequest("test").source("vector", Randomness.get().doubles(BBQ_DIMS_DEFAULT_THRESHOLD, 0.0, 5.0).toArray()))
.get();
Map<String, Object> updatedMappings = indicesAdmin().prepareGetMappings(TEST_REQUEST_TIMEOUT, "test")
.get()
.mappings()
.get("test")
.sourceAsMap();
assertTrue(new WriteField("properties.vector", () -> updatedMappings).exists());
assertTrue(new WriteField("properties.vector.index_options.type", () -> updatedMappings).get(null).toString().equals("bbq_hnsw"));

assertBusy(() -> {
Map<String, Object> updatedMappings = indicesAdmin().prepareGetMappings(TEST_REQUEST_TIMEOUT, "test")
.get()
.mappings()
.get("test")
.sourceAsMap();
assertTrue(new WriteField("properties.vector", () -> updatedMappings).exists());
assertTrue(new WriteField("properties.vector.index_options.type", () -> updatedMappings).get("").toString().equals("bbq_hnsw"));
});
}
}