Skip to content

Commit c02a647

Browse files
committed
fix yaml default pruning tests
1 parent 7a41e0f commit c02a647

File tree

3 files changed

+74
-35
lines changed

3 files changed

+74
-35
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: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -588,9 +588,27 @@ teardown:
588588
{"index": { "_id": "1" }}
589589
{"content_embedding":{"cheese": 2.671405,"is": 0.11809908,"comet": 0.26088917}}
590590
{"index": { "_id": "2" }}
591-
{"content_embedding":{"planet": 2.3438394,"is": 0.54600334,"astronomy": 0.36015007,"moon": 0.20022368}}
591+
{"content_embedding":{"planet": 2.3438394,"is": 0.14600334,"astronomy": 0.36015007,"moon": 0.20022368}}
592592
{"index": { "_id": "3" }}
593-
{"content_embedding":{"is": 0.6891394,"globe": 0.484035,"ocean": 0.080102935,"underground": 0.053516876}}
593+
{"content_embedding":{"is": 0.1891394,"globe": 0.484035,"ocean": 0.080102935,"underground": 0.053516876}}
594+
{"index": { "_id": "4" }}
595+
{"content_embedding":{"is": 0.1891394}}
596+
{"index": { "_id": "5" }}
597+
{"content_embedding":{"is": 0.1891394}}
598+
{"index": { "_id": "6" }}
599+
{"content_embedding":{"is": 0.1891394}}
600+
{"index": { "_id": "7" }}
601+
{"content_embedding":{"is": 0.1891394}}
602+
{"index": { "_id": "8" }}
603+
{"content_embedding":{"is": 0.1891394}}
604+
{"index": { "_id": "9" }}
605+
{"content_embedding":{"is": 0.1891394}}
606+
{"index": { "_id": "10" }}
607+
{"content_embedding":{"is": 0.1891394}}
608+
{"index": { "_id": "11" }}
609+
{"content_embedding":{"is": 0.1891394}}
610+
{"index": { "_id": "12" }}
611+
{"content_embedding":{"is": 0.1891394}}
594612
595613
- do:
596614
search:
@@ -600,13 +618,8 @@ teardown:
600618
sparse_vector:
601619
field: content_embedding
602620
query_vector:
603-
cheese: 0.5
604-
comet: 0.5
605-
globe: 0.484035
606-
ocean: 0.080102935
607-
underground: 0.053516876
608-
is: 0.54600334
621+
pugs: 0.5
622+
cats: 0.5
623+
is: 0.04600334
609624

610-
- match: { hits.total.value: 2 }
611-
- match: { hits.hits.0._id: "1" }
612-
- match: { hits.hits.1._id: "3" }
625+
- match: { hits.total.value: 0 }

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: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -587,9 +587,27 @@ teardown:
587587
{"index": { "_id": "1" }}
588588
{"content_embedding":{"cheese": 2.671405,"is": 0.11809908,"comet": 0.26088917}}
589589
{"index": { "_id": "2" }}
590-
{"content_embedding":{"planet": 2.3438394,"is": 0.54600334,"astronomy": 0.36015007,"moon": 0.20022368}}
590+
{"content_embedding":{"planet": 2.3438394,"is": 0.14600334,"astronomy": 0.36015007,"moon": 0.20022368}}
591591
{"index": { "_id": "3" }}
592-
{"content_embedding":{"is": 0.6891394,"globe": 0.484035,"ocean": 0.080102935,"underground": 0.053516876}}
592+
{"content_embedding":{"is": 0.1891394,"globe": 0.484035,"ocean": 0.080102935,"underground": 0.053516876}}
593+
{"index": { "_id": "4" }}
594+
{"content_embedding":{"is": 0.1891394}}
595+
{"index": { "_id": "5" }}
596+
{"content_embedding":{"is": 0.1891394}}
597+
{"index": { "_id": "6" }}
598+
{"content_embedding":{"is": 0.1891394}}
599+
{"index": { "_id": "7" }}
600+
{"content_embedding":{"is": 0.1891394}}
601+
{"index": { "_id": "8" }}
602+
{"content_embedding":{"is": 0.1891394}}
603+
{"index": { "_id": "9" }}
604+
{"content_embedding":{"is": 0.1891394}}
605+
{"index": { "_id": "10" }}
606+
{"content_embedding":{"is": 0.1891394}}
607+
{"index": { "_id": "11" }}
608+
{"content_embedding":{"is": 0.1891394}}
609+
{"index": { "_id": "12" }}
610+
{"content_embedding":{"is": 0.1891394}}
593611
594612
- do:
595613
search:
@@ -599,13 +617,8 @@ teardown:
599617
sparse_vector:
600618
field: content_embedding
601619
query_vector:
602-
cheese: 0.5
603-
comet: 0.5
604-
globe: 0.484035
605-
ocean: 0.080102935
606-
underground: 0.053516876
607-
is: 0.54600334
620+
pugs: 0.5
621+
cats: 0.5
622+
is: 0.04600334
608623

609-
- match: { hits.total.value: 2 }
610-
- match: { hits.hits.0._id: "1" }
611-
- match: { hits.hits.1._id: "3" }
624+
- match: { hits.total.value: 0 }

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

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ teardown:
899899

900900
- do:
901901
headers:
902-
Authorization: "Basic dGVzdF91c2VyOngtcGFjay10ZXN0LXBhc3N3b3Jk" #test_user credentials
902+
Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser
903903
Content-Type: application/json
904904
indices.create:
905905
index: test-sparse-vector-pruning-default
@@ -913,7 +913,7 @@ teardown:
913913

914914
- do:
915915
headers:
916-
Authorization: "Basic dGVzdF91c2VyOngtcGFjay10ZXN0LXBhc3N3b3Jk" #test_user credentials
916+
Authorization: "Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA==" # run as x_pack_rest_user, i.e. the test setup superuser
917917
Content-Type: application/json
918918
bulk:
919919
index: test-sparse-vector-pruning-default
@@ -922,9 +922,27 @@ teardown:
922922
{"index": { "_id": "1" }}
923923
{"content_embedding":{"cheese": 2.671405,"is": 0.11809908,"comet": 0.26088917}}
924924
{"index": { "_id": "2" }}
925-
{"content_embedding":{"planet": 2.3438394,"is": 0.54600334,"astronomy": 0.36015007,"moon": 0.20022368}}
925+
{"content_embedding":{"planet": 2.3438394,"is": 0.14600334,"astronomy": 0.36015007,"moon": 0.20022368}}
926926
{"index": { "_id": "3" }}
927-
{"content_embedding":{"is": 0.6891394,"globe": 0.484035,"ocean": 0.080102935,"underground": 0.053516876}}
927+
{"content_embedding":{"is": 0.1891394,"globe": 0.484035,"ocean": 0.080102935,"underground": 0.053516876}}
928+
{"index": { "_id": "4" }}
929+
{"content_embedding":{"is": 0.1891394}}
930+
{"index": { "_id": "5" }}
931+
{"content_embedding":{"is": 0.1891394}}
932+
{"index": { "_id": "6" }}
933+
{"content_embedding":{"is": 0.1891394}}
934+
{"index": { "_id": "7" }}
935+
{"content_embedding":{"is": 0.1891394}}
936+
{"index": { "_id": "8" }}
937+
{"content_embedding":{"is": 0.1891394}}
938+
{"index": { "_id": "9" }}
939+
{"content_embedding":{"is": 0.1891394}}
940+
{"index": { "_id": "10" }}
941+
{"content_embedding":{"is": 0.1891394}}
942+
{"index": { "_id": "11" }}
943+
{"content_embedding":{"is": 0.1891394}}
944+
{"index": { "_id": "12" }}
945+
{"content_embedding":{"is": 0.1891394}}
928946
929947
- do:
930948
search:
@@ -934,13 +952,8 @@ teardown:
934952
sparse_vector:
935953
field: content_embedding
936954
query_vector:
937-
cheese: 0.5
938-
comet: 0.5
939-
globe: 0.484035
940-
ocean: 0.080102935
941-
underground: 0.053516876
942-
is: 0.54600334
955+
pugs: 0.5
956+
cats: 0.5
957+
is: 0.04600334
943958

944-
- match: { hits.total.value: 2 }
945-
- match: { hits.hits.0._id: "1" }
946-
- match: { hits.hits.1._id: "3" }
959+
- match: { hits.total.value: 0 }

0 commit comments

Comments
 (0)