Skip to content

Commit 0c20978

Browse files
tteofilismalyshev
authored andcommitted
Let random_score yaml test explicitly fail on _id field (elastic#125230)
* constrain the no-field scenario to 9.x
1 parent 0ae33ec commit 0c20978

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
@@ -384,9 +384,6 @@ tests:
384384
- class: org.elasticsearch.datastreams.lifecycle.DataStreamLifecycleServiceIT
385385
method: testLifecycleAppliedToFailureStore
386386
issue: https://github.com/elastic/elasticsearch/issues/124999
387-
- class: org.elasticsearch.backwards.MixedClusterClientYamlTestSuiteIT
388-
method: test {p0=search/610_function_score/Random}
389-
issue: https://github.com/elastic/elasticsearch/issues/125010
390387
- class: org.elasticsearch.xpack.ilm.DataStreamAndIndexLifecycleMixingTests
391388
method: testGetDataStreamResponse
392389
issue: https://github.com/elastic/elasticsearch/issues/125083

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)