---
setup:
- skip:
    features:
    - "headers"
    - "allowed_warnings_regex"
---
_ignored field through get api using stored_fields:
- do:
    indices.create:
      index: "test"
      body:
        mappings:
          properties:
            keyword:
              type: "keyword"
              ignore_above: 5
            ip:
              type: "ip"
              ignore_malformed: true
            value:
              type: "long"
              ignore_malformed: 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"
      id: 1
      refresh: true
      body:
        keyword: "foo"
        ip: "192.168.0.1"
        value: 23
    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"
      id: 2
      refresh: true
      body:
        keyword: "foobar"
        ip: "garbage"
        value: "missing"
    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"
      id: 3
      refresh: true
      body:
        keyword:
        - "foo"
        - "bar"
        - "foobar"
        ip:
        - "10.10.1.1"
        - "192.8.1.2"
        - "199.199.300.999"
        value:
        - 1
        - 2
        - "ops"
    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:
    get:
      index: "test"
      id: 1
    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:
    _index: "test"
- match:
    _id: "1"
- match:
    _version: 1
- match:
    found: true
- match:
    _source:
      keyword: "foo"
      ip: "192.168.0.1"
      value: 23
- is_false: "fields"
- do:
    get:
      index: "test"
      id: 2
    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:
    _index: "test"
- match:
    _id: "2"
- match:
    _version: 1
- match:
    found: true
- match:
    _source:
      ip: "garbage"
      keyword: "foobar"
      value: "missing"
- is_false: "fields"
- do:
    get:
      index: "test"
      id: 3
    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:
    _index: "test"
- match:
    _id: "3"
- match:
    _version: 1
- match:
    found: true
- match:
    _source:
      ip:
      - "10.10.1.1"
      - "192.8.1.2"
      - "199.199.300.999"
      keyword:
      - "foo"
      - "bar"
      - "foobar"
      value:
      - 1
      - 2
      - "ops"
- is_false: "fields"
- do:
    get:
      index: "test"
      id: 1
      stored_fields:
      - "_ignored"
    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:
    _index: "test"
- match:
    _id: "1"
- match:
    _version: 1
- match:
    found: true
- match:
    _ignored: null
- do:
    get:
      index: "test"
      id: 2
      stored_fields:
      - "_ignored"
    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:
    _index: "test"
- match:
    _id: "2"
- match:
    _version: 1
- match:
    found: true
- match:
    _ignored:
    - "ip"
    - "keyword"
    - "value"
- do:
    get:
      index: "test"
      id: 3
      stored_fields:
      - "_ignored"
    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:
    _index: "test"
- match:
    _id: "3"
- match:
    _version: 1
- match:
    found: true
- match:
    _ignored:
    - "ip"
    - "keyword"
    - "value"
