[source, ruby]
----
response = client.reindex(
  body: {
    source: {
      index: 'my-index-000001'
    },
    dest: {
      index: 'my-new-index-000001',
      version_type: 'external'
    },
    script: {
      source: "if (ctx._source.foo == 'bar') {ctx._version++; ctx._source.remove('foo')}",
      lang: 'painless'
    }
  }
)
puts response
----
