Skip to content

Commit c53cf5b

Browse files
fixed yaml tests
1 parent 4a36076 commit c53cf5b

File tree

2 files changed

+32
-16
lines changed

2 files changed

+32
-16
lines changed

x-pack/plugin/inference/src/yamlRestTest/resources/rest-api-spec/test/inference/90_semantic_text_highlighter.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -416,15 +416,15 @@ setup:
416416
match_all: {}
417417
highlight:
418418
fields:
419-
body:
419+
semantic_text_field:
420420
type: "semantic"
421421
number_of_fragments: 2
422422

423423
- match: { hits.total.value: 1 }
424424
- match: { hits.hits.0._id: "doc_1" }
425-
- length: { hits.hits.0.highlight.body: 2 }
426-
- match: { hits.hits.0.highlight.body.0: "some test data" }
427-
- match: { hits.hits.0.highlight.body.1: "now with chunks" }
425+
- length: { hits.hits.0.highlight.semantic_text_field: 2 }
426+
- match: { hits.hits.0.highlight.semantic_text_field.0: "some test data" }
427+
- match: { hits.hits.0.highlight.semantic_text_field.1: "now with chunks" }
428428

429429
- do:
430430
indices.create:
@@ -457,12 +457,12 @@ setup:
457457
match_all: {}
458458
highlight:
459459
fields:
460-
body:
460+
semantic_text_field:
461461
type: "semantic"
462462
number_of_fragments: 2
463463

464464
- match: { hits.total.value: 1 }
465465
- match: { hits.hits.0._id: "doc_1" }
466-
- length: { hits.hits.0.highlight.body: 2 }
467-
- match: { hits.hits.0.highlight.body.0: "some test data" }
468-
- match: { hits.hits.0.highlight.body.1: "now with chunks" }
466+
- length: { hits.hits.0.highlight.semantic_text_field: 2 }
467+
- match: { hits.hits.0.highlight.semantic_text_field.0: "some test data" }
468+
- match: { hits.hits.0.highlight.semantic_text_field.1: "now with chunks" }

x-pack/plugin/inference/src/yamlRestTest/resources/rest-api-spec/test/inference/90_semantic_text_highlighter_bwc.yml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,14 @@ setup:
295295
cluster_features: "semantic_text.match_all_highlighter"
296296
reason: semantic text field supports match_all query with semantic highlighter, effective from 8.19 and 9.1.0.
297297

298+
- do:
299+
index:
300+
index: test-sparse-index
301+
id: doc_1
302+
body:
303+
body: [ "ElasticSearch is an open source, distributed, RESTful, search engine which is built on top of Lucene internally and enjoys all the features it provides.", "You Know, for Search!" ]
304+
refresh: true
305+
298306
- do:
299307
search:
300308
index: test-sparse-index
@@ -313,6 +321,14 @@ setup:
313321
- match: { hits.hits.0.highlight.body.0: "ElasticSearch is an open source, distributed, RESTful, search engine which is built on top of Lucene internally and enjoys all the features it provides." }
314322
- match: { hits.hits.0.highlight.body.1: "You Know, for Search!" }
315323

324+
- do:
325+
index:
326+
index: test-dense-index
327+
id: doc_1
328+
body:
329+
body: [ "ElasticSearch is an open source, distributed, RESTful, search engine which is built on top of Lucene internally and enjoys all the features it provides.", "You Know, for Search!" ]
330+
refresh: true
331+
316332
- do:
317333
search:
318334
index: test-dense-index
@@ -368,15 +384,15 @@ setup:
368384
match_all: {}
369385
highlight:
370386
fields:
371-
body:
387+
semantic_text_field:
372388
type: "semantic"
373389
number_of_fragments: 2
374390

375391
- match: { hits.total.value: 1 }
376392
- match: { hits.hits.0._id: "doc_1" }
377-
- length: { hits.hits.0.highlight.body: 2 }
378-
- match: { hits.hits.0.highlight.body.0: "some test data" }
379-
- match: { hits.hits.0.highlight.body.1: "now with chunks" }
393+
- length: { hits.hits.0.highlight.semantic_text_field: 2 }
394+
- match: { hits.hits.0.highlight.semantic_text_field.0: "some test data" }
395+
- match: { hits.hits.0.highlight.semantic_text_field.1: "now with chunks" }
380396

381397
- do:
382398
indices.create:
@@ -409,13 +425,13 @@ setup:
409425
match_all: {}
410426
highlight:
411427
fields:
412-
body:
428+
semantic_text_field:
413429
type: "semantic"
414430
number_of_fragments: 2
415431

416432
- match: { hits.total.value: 1 }
417433
- match: { hits.hits.0._id: "doc_1" }
418-
- length: { hits.hits.0.highlight.body: 2 }
419-
- match: { hits.hits.0.highlight.body.0: "some test data" }
420-
- match: { hits.hits.0.highlight.body.1: "now with chunks" }
434+
- length: { hits.hits.0.highlight.semantic_text_field: 2 }
435+
- match: { hits.hits.0.highlight.semantic_text_field.0: "some test data" }
436+
- match: { hits.hits.0.highlight.semantic_text_field.1: "now with chunks" }
421437

0 commit comments

Comments
 (0)