# How to use search\_after with match all query and without sorting?

**URL:** https://discuss.elastic.co/t/how-to-use-search-after-with-match-all-query-and-without-sorting/124179
**Category:** Elasticsearch
**Created:** [March 15, 2018, 10:53pm UTC](https://discuss.elastic.co/t/how-to-use-search-after-with-match-all-query-and-without-sorting/124179 "2018-03-15T22:53:25Z")
**Posts on this page:** 1
**Showing post:** 2

<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 15, 2018, 11:09pm UTC](https://discuss.elastic.co/t/how-to-use-search-after-with-match-all-query-and-without-sorting/124179/2 "2018-03-15T23:09:07Z")

</div>

It needs a sort key.  
The problem is that with match all you don't have anything else than \_score: 1 which can't help.

I'd recommend starting again from start but sort by \_uid which is anyway the most efficient.

BTW you should use scroll API instead.

---

_[View the full topic](https://discuss.elastic.co/t/how-to-use-search-after-with-match-all-query-and-without-sorting/124179)._
