You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: x-pack/plugin/search-business-rules/src/main/java/org/elasticsearch/xpack/searchbusinessrules/retriever/PinnedRankDoc.java
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,10 @@
1
+
/*
2
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
+
* or more contributor license agreements. Licensed under the Elastic License
4
+
* 2.0; you may not use this file except in compliance with the Elastic License
Copy file name to clipboardExpand all lines: x-pack/plugin/search-business-rules/src/yamlRestTest/resources/rest-api-spec/test/searchbusinessrules/10_pinned_retriever.yml
+63-20Lines changed: 63 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,8 @@
1
1
setup:
2
+
- requires:
3
+
cluster_features: ["pinned_retriever_test"]
4
+
reason: "pinned retriever test feature is required"
5
+
2
6
- do:
3
7
indices.create:
4
8
index: test-index1
@@ -31,7 +35,6 @@ setup:
31
35
32
36
---
33
37
"pinned retriever basic functionality":
34
-
35
38
- do:
36
39
search:
37
40
index: test-index1
@@ -50,13 +53,14 @@ setup:
50
53
- match: { hits.hits.2._id: doc3 }
51
54
- match: { hits.hits.3._id: doc4 }
52
55
- match: { hits.hits.4._id: doc5 }
56
+
- is_true: { hits.hits.0._score > 1.0 }
57
+
- is_true: { hits.hits.1._score > 1.0 }
58
+
- is_true: { hits.hits.2._score <= 1.0 }
59
+
- is_true: { hits.hits.3._score <= 1.0 }
60
+
- is_true: { hits.hits.4._score <= 1.0 }
53
61
54
62
---
55
63
"pinned retriever parameter variations":
56
-
- requires:
57
-
cluster_features: ["gte_v7.15.0"]
58
-
reason: "docs parameter support was added in 7.15"
59
-
60
64
- do:
61
65
search:
62
66
index: test-index1
@@ -76,6 +80,11 @@ setup:
76
80
- match: { hits.total.value: 5 }
77
81
- match: { hits.hits.0._id: doc1 }
78
82
- match: { hits.hits.1._id: doc2 }
83
+
- is_true: { hits.hits.0._score > 1.0 }
84
+
- is_true: { hits.hits.1._score > 1.0 }
85
+
- is_true: { hits.hits.2._score <= 1.0 }
86
+
- is_true: { hits.hits.3._score <= 1.0 }
87
+
- is_true: { hits.hits.4._score <= 1.0 }
79
88
80
89
- do:
81
90
search:
@@ -91,6 +100,11 @@ setup:
91
100
92
101
- match: { hits.total.value: 5 }
93
102
- match: { hits.hits.0._id: doc1 }
103
+
- is_true: { hits.hits.0._score > 1.0 }
104
+
- is_true: { hits.hits.1._score <= 1.0 }
105
+
- is_true: { hits.hits.2._score <= 1.0 }
106
+
- is_true: { hits.hits.3._score <= 1.0 }
107
+
- is_true: { hits.hits.4._score <= 1.0 }
94
108
95
109
- do:
96
110
search:
@@ -108,13 +122,14 @@ setup:
108
122
109
123
- match: { hits.total.value: 5 }
110
124
- match: { hits.hits.0._id: doc1 }
125
+
- is_true: { hits.hits.0._score > 1.0 }
126
+
- is_true: { hits.hits.1._score <= 1.0 }
127
+
- is_true: { hits.hits.2._score <= 1.0 }
128
+
- is_true: { hits.hits.3._score <= 1.0 }
129
+
- is_true: { hits.hits.4._score <= 1.0 }
111
130
112
131
---
113
132
"pinned retriever with combined parameters":
114
-
- requires:
115
-
cluster_features: ["gte_v7.15.0"]
116
-
reason: "combined parameters support was added in 7.15"
0 commit comments