Which is the best way to sort data in elastic search

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