// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.mjs` to generate the docs examples

[source, js]
----
const response = await client.reindex({
  source: {
    remote: {
      host: "http://otherhost:9200",
      headers: {
        Authorization: "ApiKey API_KEY_VALUE",
      },
    },
    index: "my-index-000001",
    query: {
      match: {
        test: "data",
      },
    },
  },
  dest: {
    index: "my-new-index-000001",
  },
});
console.log(response);
----
