Skip to content

Commit 03b9fde

Browse files
committed
add messages with arguments to yaml tests
1 parent 387757d commit 03b9fde

File tree

1 file changed

+21
-34
lines changed
  • x-pack/plugin/mapper-patterned-text/src/yamlRestTest/resources/rest-api-spec/test

1 file changed

+21
-34
lines changed

x-pack/plugin/mapper-patterned-text/src/yamlRestTest/resources/rest-api-spec/test/10_basic.yml

Lines changed: 21 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ setup:
1919
index:
2020
index: test
2121
id: "2"
22-
body: { "foo": "Apache Lucene powers Elasticsearch" }
22+
body: { "foo": "Found 5 errors for service [cheddar1]" }
2323

2424
- do:
2525
index:
2626
index: test
2727
id: "3"
28-
body: { "foo": "Elasticsearch is based on Apache Lucene" }
28+
body: { "foo": "[2020-08-18T00:58:56] Found 123 errors for service [cheddar1]" }
2929

3030
- do:
3131
index:
3232
index: test
3333
id: "4"
34-
body: { "foo": "The Apache Software Foundation manages many projects including Lucene" }
34+
body: { "foo": "Found some errors for cheddar data service" }
3535

3636
- do:
3737
indices.refresh: {}
@@ -70,7 +70,7 @@ Match query:
7070
body:
7171
query:
7272
match:
73-
foo: powers
73+
foo: 5
7474

7575
- match: { "hits.total.value": 1 }
7676
- match: { "hits.hits.0._score": 1.0 }
@@ -84,7 +84,7 @@ Match Phrase query:
8484
body:
8585
query:
8686
match_phrase:
87-
foo: "lucene powers"
87+
foo: "5 errors"
8888

8989
- match: { "hits.total.value": 1 }
9090
- match: { "hits.hits.0._score": 1.0 }
@@ -98,23 +98,11 @@ Match Phrase Prefix query:
9898
body:
9999
query:
100100
match_phrase_prefix:
101-
foo: "lucene pow"
101+
foo: "5 err"
102102

103103
- match: { "hits.total.value": 1 }
104104
- match: { "hits.hits.0._score": 1.0 }
105105

106-
---
107-
Match template query:
108-
109-
- do:
110-
search:
111-
index: test
112-
body:
113-
query:
114-
match:
115-
foo.template: powers
116-
117-
- match: { "hits.total.value": 1 }
118106

119107
---
120108
Query String query with phrase:
@@ -125,14 +113,13 @@ Query String query with phrase:
125113
body:
126114
query:
127115
query_string:
128-
query: '"lucene powers"'
116+
query: '"5 errors"'
129117
default_field: "foo"
130118

131119
- match: { "hits.total.value": 1 }
132120
- match: { "hits.hits.0._score": 1.0 }
133121

134122

135-
136123
---
137124
Regexp query:
138125

@@ -142,7 +129,7 @@ Regexp query:
142129
body:
143130
query:
144131
regexp:
145-
foo: "lu.*ne"
132+
foo: "ser.*ce"
146133

147134
- match: { "hits.total.value": 3 }
148135
- match: { "hits.hits.0._score": 1.0 }
@@ -156,7 +143,7 @@ Wildcard query:
156143
body:
157144
query:
158145
wildcard:
159-
foo: "lu*ne"
146+
foo: "ser*ce"
160147

161148
- match: { "hits.total.value": 3 }
162149
- match: { "hits.hits.0._score": 1.0 }
@@ -170,7 +157,7 @@ Prefix query:
170157
body:
171158
query:
172159
prefix:
173-
foo: "luc"
160+
foo: "ser"
174161

175162
- match: { "hits.total.value": 3 }
176163
- match: { "hits.hits.0._score": 1.0 }
@@ -184,7 +171,7 @@ Fuzzy query:
184171
body:
185172
query:
186173
fuzzy:
187-
foo: "lucane"
174+
foo: "errars"
188175

189176
- match: { "hits.total.value": 3 }
190177
- match: { "hits.hits.0._score": 1.0 }
@@ -199,7 +186,7 @@ Span query:
199186
body:
200187
query:
201188
span_term:
202-
foo: lucene
189+
foo: errors
203190

204191
---
205192
Term intervals query:
@@ -212,7 +199,7 @@ Term intervals query:
212199
intervals:
213200
foo:
214201
match:
215-
query: "apache lucene"
202+
query: "for service"
216203
max_gaps: 1
217204

218205
- match: { "hits.total.value": 2 }
@@ -228,7 +215,7 @@ Prefix intervals query:
228215
intervals:
229216
foo:
230217
prefix:
231-
prefix: "luc"
218+
prefix: "ser"
232219

233220
- match: { "hits.total.value": 3 }
234221

@@ -243,9 +230,9 @@ Wildcard intervals query:
243230
intervals:
244231
foo:
245232
wildcard:
246-
pattern: "*ase*"
233+
pattern: "*edda*"
247234

248-
- match: { "hits.total.value": 1 }
235+
- match: { "hits.total.value": 3 }
249236

250237
---
251238
Fuzzy intervals query:
@@ -258,7 +245,7 @@ Fuzzy intervals query:
258245
intervals:
259246
foo:
260247
fuzzy:
261-
term: "lucane"
248+
term: "servace"
262249

263250
- match: { "hits.total.value": 3 }
264251

@@ -271,14 +258,14 @@ Wildcard highlighting:
271258
body:
272259
query:
273260
match:
274-
foo: "many"
261+
foo: "5"
275262
highlight:
276263
fields:
277264
"*": {}
278265

279266
- match: { hits.total.value: 1 }
280-
- match: { hits.hits.0._source.foo: "The Apache Software Foundation manages many projects including Lucene" }
281-
- match: { hits.hits.0.highlight.foo.0: "The Apache Software Foundation manages <em>many</em> projects including Lucene" }
267+
- match: { hits.hits.0._source.foo: "Found 5 errors for service [cheddar1]" }
268+
- match: { hits.hits.0.highlight.foo.0: "Found <em>5</em> errors for service [cheddar1]" }
282269

283270
---
284271
Terms aggregation:
@@ -290,7 +277,7 @@ Terms aggregation:
290277
aggs:
291278
term_agg:
292279
terms:
293-
field: foo.template
280+
field: foo.text
294281

295282
- match: { hits.total.value: 4 }
296283
- length: { aggregations.term_agg.buckets: 10 }

0 commit comments

Comments
 (0)