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

[source, js]
----
const response0 = await client.reindex({
  body: {
    source: {
      index: 'twitter',
      slice: {
        id: 0,
        max: 2
      }
    },
    dest: {
      index: 'new_twitter'
    }
  }
})
console.log(response0)

const response1 = await client.reindex({
  body: {
    source: {
      index: 'twitter',
      slice: {
        id: 1,
        max: 2
      }
    },
    dest: {
      index: 'new_twitter'
    }
  }
})
console.log(response1)
----

