# Which is the best way to sort data in elastic search

**URL:** https://discuss.elastic.co/t/which-is-the-best-way-to-sort-data-in-elastic-search/123537
**Category:** Elasticsearch
**Created:** [March 12, 2018, 11:23am UTC](https://discuss.elastic.co/t/which-is-the-best-way-to-sort-data-in-elastic-search/123537 "2018-03-12T11:23:13Z")
**Posts on this page:** 2
**Page:** 2

<div class="post-metadata">

### Author: ![sunilkumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sunilkumar/32/28675_2.png) [@sunilkumar](https://discuss.elastic.co/u/sunilkumar)
#### Post date: [March 14, 2018, 8:34am UTC](https://discuss.elastic.co/t/which-is-the-best-way-to-sort-data-in-elastic-search/123537/21 "2018-03-14T08:34:17Z")

</div>

I fixed this issue by setting worker 1 in logstash and setting number\_of\_shards = 1 for elasticsearch. So that i have no need of using a sorting mechanism to sort the data in the same order as the one in the log file

---

<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: [April 11, 2018, 8:34am UTC](https://discuss.elastic.co/t/which-is-the-best-way-to-sort-data-in-elastic-search/123537/22 "2018-04-11T08:34:31Z")

</div>

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

[Previous page](https://discuss.elastic.co/t/which-is-the-best-way-to-sort-data-in-elastic-search/123537.md?page=1)
