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

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

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

  - do:
      indices.refresh: {}

  - do:
      delete_by_query:
        index:  test_1
        body:
          query:
            match:
              foo: bar

  - is_true: ok

  - do:
      indices.refresh: {}

  - do:
      count:
        index: test_1

  - match:  { count:     2  }

---
"Basic delete_by_query, post 1.0":
  - skip:
      version: "0 - 0.999"
      reason: "Since 1.0 the query top-level key in the body is required"
  - do:
      index:
          index:  test_1
          type:   test
          id:     1
          body:   { foo: bar }

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

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

  - do:
      indices.refresh: {}

  - do:
      delete_by_query:
        index:  test_1
        body:
          query:
            match:
              foo: bar

  - is_true: ok

  - do:
      indices.refresh: {}

  - do:
      count:
        index: test_1

  - match:  { count:     2  }
---
"Basic delete_by_query, pre 1.0":
  - skip:
      version: "1 - 999"
      reason: "Since 1.0 the query top-level key in the body is required"
  - do:
      index:
          index:  test_1
          type:   test
          id:     1
          body:   { foo: bar }

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

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

  - do:
      indices.refresh: {}

  - do:
      delete_by_query:
        index:  test_1
        body:
          match:
            foo: bar

  - is_true: ok

  - do:
      indices.refresh: {}

  - do:
      count:
        index: test_1

  - match:  { count:     2  }

Split delete by query tests pre-1.0 and post-1.0
[TEST] Split delete by query tests pre-1.0 and post-1.0

See #4074 for details
