---
"Update-by-query picks up new fields":
  - do:
      indices.create:
        index: test
        body:
          mappings:
            properties:
              name:
                type: keyword
  - do:
      index:
        index:   test
        id:      "1"
        refresh: true
        body:    { "name": "bob! house" }

  - do:
      indices.put_mapping:
        index: test
        body:
          properties:
            name:
              type: keyword
              fields:
                english:
                  type:     text

  - do:
      search:
        rest_total_hits_as_int: true
        index: test
        body:
          query:
            match:
              name.english: bob
  - match: { hits.total: 0 }

  - do:
      update_by_query:
        index: test
  - do:
      indices.refresh: {}

  - do:
      search:
        rest_total_hits_as_int: true
        index: test
        body:
          query:
            match:
              name.english: bob
  - match: { hits.total: 1 }
