---
setup:
- skip:
    features:
    - "headers"
    - "allowed_warnings_regex"
---
Stored fields:
- do:
    indices.create:
      index: "test_1"
      body:
        mappings:
          properties:
            foo:
              type: "keyword"
              store: true
            count:
              type: "integer"
              store: true
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    index:
      index: "test_1"
      id: "1"
      body:
        foo: "bar"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    mget:
      index: "test_1"
      body:
        docs:
        - _id: "1"
        - _id: "1"
          stored_fields: "foo"
        - _id: "1"
          stored_fields:
          - "foo"
        - _id: "1"
          stored_fields:
          - "foo"
          - "_source"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- is_false: "docs.0.fields"
- match:
    docs.0._source:
      foo: "bar"
- match:
    docs.1.fields.foo:
    - "bar"
- is_false: "docs.1._source"
- match:
    docs.2.fields.foo:
    - "bar"
- is_false: "docs.2._source"
- match:
    docs.3.fields.foo:
    - "bar"
- match:
    docs.3._source:
      foo: "bar"
- do:
    mget:
      index: "test_1"
      stored_fields: "foo"
      body:
        docs:
        - _id: "1"
        - _id: "1"
          stored_fields: "foo"
        - _id: "1"
          stored_fields:
          - "foo"
        - _id: "1"
          stored_fields:
          - "foo"
          - "_source"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    docs.0.fields.foo:
    - "bar"
- is_false: "docs.0._source"
- match:
    docs.1.fields.foo:
    - "bar"
- is_false: "docs.1._source"
- match:
    docs.2.fields.foo:
    - "bar"
- is_false: "docs.2._source"
- match:
    docs.3.fields.foo:
    - "bar"
- match:
    docs.3._source:
      foo: "bar"
- do:
    mget:
      index: "test_1"
      stored_fields:
      - "foo"
      body:
        docs:
        - _id: "1"
        - _id: "1"
          stored_fields: "foo"
        - _id: "1"
          stored_fields:
          - "foo"
        - _id: "1"
          stored_fields:
          - "foo"
          - "_source"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    docs.0.fields.foo:
    - "bar"
- is_false: "docs.0._source"
- match:
    docs.1.fields.foo:
    - "bar"
- is_false: "docs.1._source"
- match:
    docs.2.fields.foo:
    - "bar"
- is_false: "docs.2._source"
- match:
    docs.3.fields.foo:
    - "bar"
- match:
    docs.3._source:
      foo: "bar"
- do:
    mget:
      index: "test_1"
      stored_fields:
      - "foo"
      - "_source"
      body:
        docs:
        - _id: "1"
        - _id: "1"
          stored_fields: "foo"
        - _id: "1"
          stored_fields:
          - "foo"
        - _id: "1"
          stored_fields:
          - "foo"
          - "_source"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    docs.0.fields.foo:
    - "bar"
- match:
    docs.0._source:
      foo: "bar"
- match:
    docs.1.fields.foo:
    - "bar"
- is_false: "docs.1._source"
- match:
    docs.2.fields.foo:
    - "bar"
- is_false: "docs.2._source"
- match:
    docs.3.fields.foo:
    - "bar"
- match:
    docs.3._source:
      foo: "bar"
