Skip to content

Commit 8d0e630

Browse files
authored
Updating text_similarity_reranker tests to account for the test_reranking_service (#114945)
1 parent f29ebd3 commit 8d0e630

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

x-pack/plugin/inference/src/yamlRestTest/resources/rest-api-spec/test/inference/70_text_similarity_rank_retriever.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
setup:
2+
- skip:
3+
features:
4+
- close_to
5+
- contains
26
- requires:
37
cluster_features: "text_similarity_reranker_retriever_supported"
48
reason: semantic reranking introduced in 8.15.0
@@ -206,8 +210,8 @@ setup:
206210
size: 10
207211
explain: true
208212

209-
- match: { hits.hits.0._id: "doc_2" }
210-
- match: { hits.hits.1._id: "doc_1" }
213+
- contains: { hits.hits: { _id: "doc_2" } }
214+
- contains: { hits.hits: { _id: "doc_1" } }
211215

212216
- close_to: { hits.hits.0._explanation.value: { value: 0.4, error: 0.000001 } }
213217
- match: {hits.hits.0._explanation.description: "/text_similarity_reranker.match.using.inference.endpoint:.\\[my-rerank-model\\].on.document.field:.\\[text\\].*/" }

x-pack/plugin/rank-rrf/src/yamlRestTest/resources/rest-api-spec/test/rrf/800_rrf_with_text_similarity_reranker_retriever.yml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
setup:
2+
- skip:
3+
features:
4+
- close_to
5+
- contains
6+
27
- requires:
38
cluster_features: ['rrf_retriever_composition_supported', 'text_similarity_reranker_retriever_supported']
49
reason: need to have support for rrf and semantic reranking composition
@@ -125,9 +130,6 @@ setup:
125130
term: {
126131
topic: "science"
127132
}
128-
},
129-
"sort": {
130-
"integer": "asc"
131133
}
132134
}
133135
},
@@ -152,8 +154,8 @@ setup:
152154
- match: { hits.total.value: 3 }
153155
- length: { hits.hits: 2 }
154156

155-
- match: { hits.hits.0._id: "doc_1" }
156-
- match: { hits.hits.1._id: "doc_3" }
157+
- contains: { hits.hits: { _id: "doc_1" } }
158+
- contains: { hits.hits: { _id: "doc_3" } }
157159

158160
- match: { aggregations.topics.buckets.0.key: "science" }
159161
- match: { aggregations.topics.buckets.0.doc_count: 2 }
@@ -304,11 +306,8 @@ setup:
304306
standard: {
305307
query: {
306308
term: {
307-
topic: "science"
309+
subtopic: "astronomy"
308310
}
309-
},
310-
"sort": {
311-
"integer": "asc"
312311
}
313312
}
314313
},
@@ -327,14 +326,13 @@ setup:
327326

328327
- match: { hits.hits.0._id: "doc_2" }
329328
- match: { hits.hits.1._id: "doc_1" }
330-
- match: { hits.hits.2._id: "doc_3" }
331329

332-
- close_to: { hits.hits.0._explanation.value: { value: 0.6666667, error: 0.000001 } }
333-
- match: {hits.hits.0._explanation.description: "/rrf.score:.\\[0.6666667\\].*/" }
330+
- close_to: { hits.hits.0._explanation.value: { value: 0.833333, error: 0.0001 } }
331+
- match: {hits.hits.0._explanation.description: "/rrf.score:.\\[0.8333334\\].*/" }
334332
- match: {hits.hits.0._explanation.details.0.value: 2}
335333
- match: {hits.hits.0._explanation.details.0.description: "/rrf.score:.\\[0.33333334\\].*/" }
336334
- match: {hits.hits.0._explanation.details.0.details.0.details.0.description: "/ConstantScore.*/" }
337-
- match: {hits.hits.0._explanation.details.1.value: 2}
338-
- match: {hits.hits.0._explanation.details.1.description: "/rrf.score:.\\[0.33333334\\].*/" }
335+
- match: {hits.hits.0._explanation.details.1.value: 1}
336+
- match: {hits.hits.0._explanation.details.1.description: "/rrf.score:.\\[0.5\\].*/" }
339337
- match: {hits.hits.0._explanation.details.1.details.0.description: "/text_similarity_reranker.match.using.inference.endpoint:.\\[my-rerank-model\\].on.document.field:.\\[text\\].*/" }
340-
- match: {hits.hits.0._explanation.details.1.details.0.details.0.description: "/weight.*science.*/" }
338+
- match: {hits.hits.0._explanation.details.1.details.0.details.0.description: "/weight.*astronomy.*/" }

0 commit comments

Comments
 (0)