# Copy of the index with specified sample size

**URL:** <https://discuss.elastic.co/t/copy-of-the-index-with-specified-sample-size/142646>\
**Category:** Elasticsearch\
**Created:** [August 1, 2018, 7:55pm UTC](https://discuss.elastic.co/t/copy-of-the-index-with-specified-sample-size/142646 "2018-08-01T19:55:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Buntu\_Dev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/buntu_dev/32/117258_2.png) [@Buntu\_Dev](https://discuss.elastic.co/u/Buntu_Dev)\
**Post date:** [August 1, 2018, 7:55pm UTC](https://discuss.elastic.co/t/copy-of-the-index-with-specified-sample-size/142646/1 "2018-08-01T19:55:44Z")

</div>

Is there a way to make a copy of the index into another cluster with just a sample of the source index? I'm using ES6 and wanted to see if there are any easier ways to get a sample of the index for testing purposes?

Thanks!

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [August 2, 2018, 9:03am UTC](https://discuss.elastic.co/t/copy-of-the-index-with-specified-sample-size/142646/2 "2018-08-02T09:03:03Z")

</div>

Hey,

how about using reindex from remote with a query to limit the data? See [https://www.elastic.co/guide/en/elasticsearch/reference/6.3/docs-reindex.html#reindex-from-remote](https://www.elastic.co/guide/en/elasticsearch/reference/6.3/docs-reindex.html#reindex-from-remote)

--Alex

---

<div class="post-metadata">

**Author:** ![Buntu\_Dev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/buntu_dev/32/117258_2.png) [@Buntu\_Dev](https://discuss.elastic.co/u/Buntu_Dev)\
**Post date:** [August 2, 2018, 5:58pm UTC](https://discuss.elastic.co/t/copy-of-the-index-with-specified-sample-size/142646/3 "2018-08-02T17:58:11Z")

</div>

Thanks for the pointer, will give it a try. Not sure how it works but will it be a random sample if I do a limit?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [August 6, 2018, 8:08am UTC](https://discuss.elastic.co/t/copy-of-the-index-with-specified-sample-size/142646/4 "2018-08-06T08:08:10Z")

</div>

no, it is not random. Either a document matches or does not match the query, sorting does not matter. Hope that makes sense.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 3, 2018, 8:08am UTC](https://discuss.elastic.co/t/copy-of-the-index-with-specified-sample-size/142646/5 "2018-09-03T08:08:14Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
