# Sorting with from and to with search\_after

**URL:** <https://discuss.elastic.co/t/sorting-with-from-and-to-with-search-after/208755>\
**Category:** Elasticsearch\
**Created:** [November 20, 2019, 6:39pm UTC](https://discuss.elastic.co/t/sorting-with-from-and-to-with-search-after/208755 "2019-11-20T18:39:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dkishore](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dkishore/32/58054_2.png) [@dkishore](https://discuss.elastic.co/u/dkishore)\
**Post date:** [November 20, 2019, 6:39pm UTC](https://discuss.elastic.co/t/sorting-with-from-and-to-with-search-after/208755/1 "2019-11-20T18:39:02Z")

</div>

Hi

How to sort on all the available values on an index with from and to with search\_after

like below  
when we use **from:0** it always picks the 100 records and performs a sort on that chunk of items

from:0,  
"size": 100,  
"query": {  
"match" : {  
"title" : "elasticsearch"  
}  
},  
"search\_after": [1463538857, "654323"],  
"sort": [  
{"date": "asc"},  
{"tie\_breaker\_id": "asc"}  
]

how can we perform a sort on all records with from and to with search\_after option

---

<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:** [December 18, 2019, 6:39pm UTC](https://discuss.elastic.co/t/sorting-with-from-and-to-with-search-after/208755/2 "2019-12-18T18:39:03Z")

</div>

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