# Paged search data duplication

**URL:** https://discuss.elastic.co/t/paged-search-data-duplication/121995
**Category:** Elasticsearch
**Created:** [March 1, 2018, 8:31am UTC](https://discuss.elastic.co/t/paged-search-data-duplication/121995 "2018-03-01T08:31:40Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![f31c59547d1455e5f346](https://avatars.discourse-cdn.com/v4/letter/f/77aa72/32.png) [@f31c59547d1455e5f346](https://discuss.elastic.co/u/f31c59547d1455e5f346)
#### Post date: [March 1, 2018, 8:31am UTC](https://discuss.elastic.co/t/paged-search-data-duplication/121995/1 "2018-03-01T08:31:40Z")

</div>

Elasticsearc version (5.3.0)

The first page of the page is normal, and the second page has the same data as the first page.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/2/02b66c7b6c144a605e2dc87b6f86b4920ccf4d39.png)

How to optimize

---

<div class="post-metadata">

### Author: ![onion](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/onion/32/28286_2.png) [@onion](https://discuss.elastic.co/u/onion)
#### Post date: [March 1, 2018, 9:00am UTC](https://discuss.elastic.co/t/paged-search-data-duplication/121995/2 "2018-03-01T09:00:40Z")

</div>

If your page number from 0 start， change your code : `setFrom(pageNumber*pageSize)`  
If 1，`setFrom((pageNumber-1)*pageSize)`

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [March 1, 2018, 3:35pm UTC](https://discuss.elastic.co/t/paged-search-data-duplication/121995/3 "2018-03-01T15:35:06Z")

</div>

Please don't post images of text as they are hardly readable and not searchable.

Instead paste the text and format it with `</>` icon. Check the preview window.

---

<div class="post-metadata">

### Author: ![f31c59547d1455e5f346](https://avatars.discourse-cdn.com/v4/letter/f/77aa72/32.png) [@f31c59547d1455e5f346](https://discuss.elastic.co/u/f31c59547d1455e5f346)
#### Post date: [March 2, 2018, 2:09am UTC](https://discuss.elastic.co/t/paged-search-data-duplication/121995/4 "2018-03-02T02:09:32Z")

</div>

Thank you. I noticed this problem yesterday and changed it, but it is not helpful for the second page or even more pages to appear in the data.

---

<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: [March 30, 2018, 2:09am UTC](https://discuss.elastic.co/t/paged-search-data-duplication/121995/5 "2018-03-30T02:09:33Z")

</div>

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