Skip to content

Commit 79f7e21

Browse files
committed
Let random_score yaml test explicitly fail on _id field (#125230)
* constrain the no-field scenario to 9.x (cherry picked from commit 6d3dac3) # Conflicts: # muted-tests.yml
1 parent 8f6e0ff commit 79f7e21

File tree

2 files changed

+44
-7
lines changed

2 files changed

+44
-7
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,6 @@ tests:
258258
- class: org.elasticsearch.xpack.restart.MLModelDeploymentFullClusterRestartIT
259259
method: testDeploymentSurvivesRestart {cluster=OLD}
260260
issue: https://github.com/elastic/elasticsearch/issues/124160
261-
- class: org.elasticsearch.backwards.MixedClusterClientYamlTestSuiteIT
262-
method: test {p0=search/610_function_score/Random}
263-
issue: https://github.com/elastic/elasticsearch/issues/125010
264261

265262
# Examples:
266263
#

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search/610_function_score.yml

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,55 @@
7171
}
7272
},
7373
"random_score": {
74-
"seed": 10
74+
"seed": 10,
75+
"field": "uuid"
7576
}
7677
}
7778

7879
- length: { hits.hits: 2 }
7980
- match: { hits.total.value: 2 }
8081

82+
---
83+
"No field only runs on 9.x":
84+
- requires:
85+
cluster_features: [ "gte_v9.0.0" ]
86+
reason: "empty field works seamlessly (relying on _seqno since 9.x)"
87+
- do:
88+
indices.create:
89+
index: test
90+
body:
91+
mappings:
92+
properties:
93+
text:
94+
type: text
95+
96+
- do:
97+
index:
98+
index: test
99+
id: "1"
100+
body: { text: "foo bar", uuid: 1234 }
101+
102+
- do:
103+
index:
104+
index: test
105+
id: "2"
106+
body: { text: "high bar", uuid: 5678 }
107+
108+
- do:
109+
index:
110+
index: test
111+
id: "3"
112+
body: { text: "raise bar", uuid: 9012 }
113+
114+
- do:
115+
index:
116+
index: test
117+
id: "3"
118+
body: { text: "raise hands", uuid: 3456 }
119+
120+
- do:
121+
indices.refresh:
122+
index: [ test ]
81123
- do:
82124
search:
83125
index: test
@@ -91,10 +133,8 @@
91133
}
92134
},
93135
"random_score": {
94-
"seed": 10,
95-
"field": "uuid"
136+
"seed": 10
96137
}
97138
}
98-
99139
- length: { hits.hits: 2 }
100140
- match: { hits.total.value: 2 }

0 commit comments

Comments
 (0)