---
setup:
- skip:
    features:
    - "headers"
    - "allowed_warnings_regex"
---
Multi Get with alias that resolves to multiple indices:
- requires:
    cluster_features:
    - "gte_v7.9.0"
    reason: "message was changed to fix grammar in 7.9"
- do:
    bulk:
      refresh: true
      body: "{\"index\": {\"_index\": \"test_1\", \"_id\": 1}}\n{ \"foo\": \"bar\"\
        \ }\n{\"index\": {\"_index\": \"test_2\", \"_id\": 2}}\n{ \"foo\": \"bar\"\
        \ }\n{\"index\": {\"_index\": \"test_3\", \"_id\": 3}}\n{ \"foo\": \"bar\"\
        \ }\n"
    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:
    indices.put_alias:
      index: "test_2"
      name: "test_two_and_three"
    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:
    indices.put_alias:
      index: "test_3"
      name: "test_two_and_three"
    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:
      body:
        docs:
        - _index: "test_1"
          _id: "1"
        - _index: "test_two_and_three"
          _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"
- is_true: "docs.0.found"
- match:
    docs.0._index: "test_1"
- match:
    docs.0._id: "1"
- is_false: "docs.1.found"
- match:
    docs.1._index: "test_two_and_three"
- match:
    docs.1._id: "2"
- match:
    docs.1.error.root_cause.0.type: "illegal_argument_exception"
- match:
    docs.1.error.root_cause.0.reason: "/[aA]lias.\\[test_two_and_three\\].has.more.than.one.index.associated.with.it.\\\
      [test_[23]{1},.test_[23]{1}\\],.can't.execute.a.single.index.op/"
