Skip to content

Commit fe0757c

Browse files
committed
chore: add sparse vector pruning tests
1 parent ff06e46 commit fe0757c

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/ml/sparse_vector_search.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ teardown:
944944
{"index": { "_id": "11" }}
945945
{"content_embedding":{"is": 0.6, "pugs": 0.6 }}
946946
{"index": { "_id": "12" }}
947-
{"content_embedding":{"is": 0.1891394, "pugs": 0.1 }}
947+
{"content_embedding":{"cats": 0.1 }}
948948
949949
- do:
950950
search:
@@ -955,13 +955,25 @@ teardown:
955955
field: content_embedding
956956
query_vector:
957957
pugs: 0.5
958-
cats: 0.5
959-
is: 0.04600334
958+
cats: 0.18
959+
is: 0.2
960960

961961
- match: { hits.total.value: 2 }
962962
- match: { hits.hits.0._id: "11" }
963963
- match: { hits.hits.1._id: "12" }
964964

965+
- do:
966+
search:
967+
index: test-sparse-vector-pruning-default
968+
body:
969+
query:
970+
sparse_vector:
971+
field: content_embedding
972+
query_vector:
973+
is: 0.21
974+
975+
- match: { hits.total.value: 11 }
976+
965977
- do:
966978
search:
967979
index: test-sparse-vector-pruning-default

0 commit comments

Comments
 (0)