Skip to content

Commit 22f9af9

Browse files
Adding yaml test for field caps not filtering multi-field
1 parent 0b11a20 commit 22f9af9

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

x-pack/plugin/inference/src/yamlRestTest/resources/rest-api-spec/test/inference/10_semantic_text_field_mapping.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,3 +383,52 @@ setup:
383383
- not_exists: fields.dense_field.inference.chunks.offset
384384
- not_exists: fields.dense_field.inference.chunks
385385
- not_exists: fields.dense_field.inference
386+
387+
---
388+
"Field caps does not exclude multi-fields under semantic_text":
389+
- requires:
390+
cluster_features: "semantic_text.exclude_sub_fields_from_field_caps"
391+
reason: field caps api exclude semantic_text subfields from 9.1.0 & 8.19.0
392+
- do:
393+
indices.create:
394+
index: test-multi-field-index
395+
body:
396+
settings:
397+
index:
398+
mapping:
399+
semantic_text:
400+
use_legacy_format: false
401+
mappings:
402+
properties:
403+
sparse_field:
404+
type: semantic_text
405+
inference_id: sparse-inference-id
406+
fields:
407+
sparse_keyword_field:
408+
type: keyword
409+
dense_field:
410+
type: semantic_text
411+
inference_id: dense-inference-id
412+
fields:
413+
dense_keyword_field:
414+
type: keyword
415+
416+
- do:
417+
field_caps:
418+
include_empty_fields: true
419+
index: test-multi-field-index
420+
fields: "*"
421+
422+
- match: { indices: [ "test-multi-field-index" ] }
423+
- exists: fields.sparse_field
424+
- exists: fields.dense_field
425+
- exists: fields.sparse_field.sparse_keyword_field
426+
- exists: fields.dense_field.dense_keyword_field
427+
- not_exists: fields.sparse_field.inference.chunks.embeddings
428+
- not_exists: fields.sparse_field.inference.chunks.offset
429+
- not_exists: fields.sparse_field.inference.chunks
430+
- not_exists: fields.sparse_field.inference
431+
- not_exists: fields.dense_field.inference.chunks.embeddings
432+
- not_exists: fields.dense_field.inference.chunks.offset
433+
- not_exists: fields.dense_field.inference.chunks
434+
- not_exists: fields.dense_field.inference

0 commit comments

Comments
 (0)