# Sort by ids

**URL:** <https://discuss.elastic.co/t/sort-by-ids/5358>\
**Category:** Elasticsearch\
**Created:** [September 12, 2011, 3:11pm UTC](https://discuss.elastic.co/t/sort-by-ids/5358 "2011-09-12T15:11:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcus](https://avatars.discourse-cdn.com/v4/letter/m/85e7bf/32.png) [@marcus](https://discuss.elastic.co/u/marcus)\
**Post date:** [September 12, 2011, 3:11pm UTC](https://discuss.elastic.co/t/sort-by-ids/5358/1 "2011-09-12T15:11:25Z")

</div>

Hi all,

I'm doing a search where you can filter on some different attributes in combinations. One of the attributes that I have is searching for ids ([http://www.elasticsearch.org/guide/reference/query-dsl/ids-query.html](http://www.elasticsearch.org/guide/reference/query-dsl/ids-query.html)).

When I add values to the filter I would like the sorting to be in the order that I send in the ids into the filter. Does anyone know if this is possible?

Cheers!

---

<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:** [July 6, 2017, 3:54am UTC](https://discuss.elastic.co/t/sort-by-ids/5358/2 "2017-07-06T03:54:42Z")

</div>


