File tree Expand file tree Collapse file tree 2 files changed +39
-1
lines changed
rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search.vectors
server/src/main/java/org/elasticsearch/search Expand file tree Collapse file tree 2 files changed +39
-1
lines changed Original file line number Diff line number Diff line change @@ -25,8 +25,43 @@ setup:
2525 - match : { test.mappings.properties.vector.dims: 5 }
2626 - match : { test.mappings.properties.vector.index: true }
2727 - match : { test.mappings.properties.vector.similarity: cosine }
28+
29+ ---
30+ " Indexed by default with specified similarity and index options " :
31+ - do :
32+ indices.create :
33+ index : test
34+ body :
35+ mappings :
36+ properties :
37+ vector :
38+ type : dense_vector
39+ dims : 5
40+ similarity : dot_product
41+ index_options :
42+ type : hnsw
43+ m : 32
44+ ef_construction : 200
45+
46+ - match : { acknowledged: true }
47+
48+ - do :
49+ indices.get_mapping :
50+ index : test
51+
52+ - match : { test.mappings.properties.vector.type: dense_vector }
53+ - match : { test.mappings.properties.vector.dims: 5 }
54+ - match : { test.mappings.properties.vector.index: true }
55+ - match : { test.mappings.properties.vector.similarity: dot_product }
56+ - match : { test.mappings.properties.vector.index_options.type: hnsw }
57+ - match : { test.mappings.properties.vector.index_options.m: 32 }
58+ - match : { test.mappings.properties.vector.index_options.ef_construction: 200 }
59+ - match : { test.mappings.properties.vector.index_options.early_termination: null }
60+
2861---
2962" Indexed by default with specified similarity and index options " :
63+ - cluster_features : [ "search.vectors.mappers.expose_hnsw_early_termination" ]
64+ - reason : " requires early termination for hnsw to be exposed"
3065 - do :
3166 indices.create :
3267 index : test
5590 - match : { test.mappings.properties.vector.index_options.type: hnsw }
5691 - match : { test.mappings.properties.vector.index_options.m: 32 }
5792 - match : { test.mappings.properties.vector.index_options.ef_construction: 200 }
93+ - match : { test.mappings.properties.vector.index_options.early_termination: false }
5894
5995---
6096" Not indexed vector " :
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ public Set<NodeFeature> getFeatures() {
3232 public static final NodeFeature INT_SORT_FOR_INT_SHORT_BYTE_FIELDS = new NodeFeature ("search.sort.int_sort_for_int_short_byte_fields" );
3333 static final NodeFeature MULTI_MATCH_CHECKS_POSITIONS = new NodeFeature ("search.multi.match.checks.positions" );
3434 public static final NodeFeature BBQ_HNSW_DEFAULT_INDEXING = new NodeFeature ("search.vectors.mappers.default_bbq_hnsw" );
35+ public static final NodeFeature EXPOSE_HNSW_EARLY_TERMINATION = new NodeFeature ("search.vectors.mappers.expose_hnsw_early_termination" );
3536
3637 @ Override
3738 public Set <NodeFeature > getTestFeatures () {
@@ -41,7 +42,8 @@ public Set<NodeFeature> getTestFeatures() {
4142 RESCORER_MISSING_FIELD_BAD_REQUEST ,
4243 INT_SORT_FOR_INT_SHORT_BYTE_FIELDS ,
4344 MULTI_MATCH_CHECKS_POSITIONS ,
44- BBQ_HNSW_DEFAULT_INDEXING
45+ BBQ_HNSW_DEFAULT_INDEXING ,
46+ EXPOSE_HNSW_EARLY_TERMINATION
4547 );
4648 }
4749}
You can’t perform that action at this time.
0 commit comments