# Search after - unique sort fields

**URL:** <https://discuss.elastic.co/t/search-after-unique-sort-fields/139355>\
**Category:** Elasticsearch\
**Created:** [July 10, 2018, 1:31pm UTC](https://discuss.elastic.co/t/search-after-unique-sort-fields/139355 "2018-07-10T13:31:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wmazur](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wmazur/32/33196_2.png) [@wmazur](https://discuss.elastic.co/u/wmazur)\
**Post date:** [July 10, 2018, 1:31pm UTC](https://discuss.elastic.co/t/search-after-unique-sort-fields/139355/1 "2018-07-10T13:31:43Z")

</div>

I'm trying to use search after pagination in my project, using index with over 10M records.

I wonder what's the easiest way to obtain unique search\_after parameter if i don't mind about sort order and I don't want to define it?  
Using \_doc or \_seq\_no field only generates duplicates in an adequate number as number of shards.  
Does using combination of thoose two fields guarantees uniqueness?

---

<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:** [August 7, 2018, 1:31pm UTC](https://discuss.elastic.co/t/search-after-unique-sort-fields/139355/2 "2018-08-07T13:31:45Z")

</div>

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