Skip to content

Commit 3546602

Browse files
committed
update yaml tests
1 parent 75bb40a commit 3546602

File tree

3 files changed

+32
-7
lines changed

3 files changed

+32
-7
lines changed

x-pack/plugin/ml/qa/multi-cluster-tests-with-security/src/test/resources/rest-api-spec/test/multi_cluster/50_sparse_vector.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ teardown:
622622
{"index": { "_id": "11" }}
623623
{"content_embedding":{"is": 0.6, "pugs": 0.6 }}
624624
{"index": { "_id": "12" }}
625-
{"content_embedding":{"is": 0.1891394, "pugs": 0.1 }}
625+
{"content_embedding":{"cats": 0.1 }}
626626
627627
- do:
628628
search:
@@ -633,13 +633,25 @@ teardown:
633633
field: content_embedding
634634
query_vector:
635635
pugs: 0.5
636-
cats: 0.5
637-
is: 0.04600334
636+
cats: 0.18
637+
is: 0.20
638638

639639
- match: { hits.total.value: 2 }
640640
- match: { hits.hits.0._id: "11" }
641641
- match: { hits.hits.1._id: "12" }
642642

643+
- do:
644+
search:
645+
index: test-sparse-vector-pruning-default
646+
body:
647+
query:
648+
sparse_vector:
649+
field: content_embedding
650+
query_vector:
651+
is: 0.21 # 0.2 is the weight threshold for the default pruning config
652+
653+
- match: { hits.total.value: 11 }
654+
643655
- do:
644656
search:
645657
index: test-sparse-vector-pruning-default

x-pack/plugin/ml/qa/multi-cluster-tests-with-security/src/test/resources/rest-api-spec/test/remote_cluster/50_sparse_vector.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ teardown:
620620
{"index": { "_id": "11" }}
621621
{"content_embedding":{"is": 0.6, "pugs": 0.6 }}
622622
{"index": { "_id": "12" }}
623-
{"content_embedding":{"is": 0.1891394, "pugs": 0.1 }}
623+
{"content_embedding":{"cats": 0.1 }}
624624
625625
- do:
626626
search:
@@ -631,13 +631,26 @@ teardown:
631631
field: content_embedding
632632
query_vector:
633633
pugs: 0.5
634-
cats: 0.5
635-
is: 0.04600334
634+
cats: 0.18
635+
is: 0.20
636636

637637
- match: { hits.total.value: 2 }
638638
- match: { hits.hits.0._id: "11" }
639639
- match: { hits.hits.1._id: "12" }
640640

641+
- do:
642+
search:
643+
index: test-sparse-vector-pruning-default
644+
body:
645+
query:
646+
sparse_vector:
647+
field: content_embedding
648+
query_vector:
649+
is: 0.21 # 0.2 is the weight threshold for the default pruning config
650+
651+
- match: { hits.total.value: 11 }
652+
653+
641654
- do:
642655
search:
643656
index: test-sparse-vector-pruning-default

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ teardown:
970970
sparse_vector:
971971
field: content_embedding
972972
query_vector:
973-
is: 0.21
973+
is: 0.21 # 0.2 is the weight threshold for the default pruning config
974974

975975
- match: { hits.total.value: 11 }
976976

0 commit comments

Comments
 (0)