---
"IDs":
  - skip:
        # this will only run in a mixed cluster environment with at least 1 5.x node
        version: "5.99.99 - "
        reason:  multiple types are not supported on 6.x indices onwards

  - do:
        indices.create:
          index: test_1

  - do:
      index:
          index:  test_1
          type:   test
          id:     1
          body:   { foo: bar }

  - do:
      index:
          index:  test_1
          type:   test_2
          id:     2
          body:   { foo: baz }

  - do:
      mget:
        index:  test_1
        type:   test
        body:
          ids: [1, 2]

  - is_true:  docs.0.found
  - match:  { docs.0._index:     test_1      }
  - match:  { docs.0._type:      test        }
  - match:  { docs.0._id:        "1"         }
  - match:  { docs.0._version:   1           }
  - match:  { docs.0._source:    { foo: bar }}

  - is_false: docs.1.found
  - match:  { docs.1._index:     test_1      }
  - match:  { docs.1._type:      test        }
  - match:  { docs.1._id:        "2"         }

  - do:
      mget:
        index:  test_1
        body:
          ids: [1, 2]

  - is_true:  docs.0.found
  - match:  { docs.0._index:     test_1      }
  - match:  { docs.0._type:      test        }
  - match:  { docs.0._id:        "1"         }
  - match:  { docs.0._version:   1           }
  - match:  { docs.0._source:    { foo: bar }}

  - is_true:  docs.1.found
  - match:  { docs.1._index:     test_1      }
  - match:  { docs.1._type:      test_2      }
  - match:  { docs.1._id:        "2"         }
  - match:  { docs.1._version:   1           }
  - match:  { docs.1._source:    { foo: baz }}


  - do:
      catch:  /action_request_validation_exception.+ no documents to get/
      mget:
        index:  test_1
        body:
          ids: []

  - do:
      catch:  /action_request_validation_exception.+ no documents to get/
      mget:
        index:  test_1
        body:   {}
