# Exact sort

**URL:** <https://discuss.elastic.co/t/exact-sort/6101>\
**Category:** Elasticsearch\
**Created:** [December 8, 2011, 6:53pm UTC](https://discuss.elastic.co/t/exact-sort/6101 "2011-12-08T18:53:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Carlo\_2](https://avatars.discourse-cdn.com/v4/letter/c/a9adbd/32.png) [@Carlo\_2](https://discuss.elastic.co/u/Carlo_2)\
**Post date:** [December 8, 2011, 6:53pm UTC](https://discuss.elastic.co/t/exact-sort/6101/1 "2011-12-08T18:53:27Z")

</div>

Hi all,

I'm new to ES so sorry if my question will be stupid!

Anyway I'm trying to fetch some documents with a filter based on a  
custom field that doesn't exists in my index and I'd like to specify  
the order they should be returned. How can I do?

For example I want to say:

give me the docs in this order:

custom\_field = 1 will be the first  
custom\_field = 4 will be the second  
custom field = 5 the third  
...

and I cannot add it to the index

Any help will be appreciated!

---

<div class="post-metadata">

**Author:** ![Karussell1](https://avatars.discourse-cdn.com/v4/letter/k/50afbb/32.png) [@Karussell1](https://discuss.elastic.co/u/Karussell1)\
**Post date:** [December 8, 2011, 8:39pm UTC](https://discuss.elastic.co/t/exact-sort/6101/2 "2011-12-08T20:39:10Z")

</div>

> give me the docs in this order:

you'll need to include the sort:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

> and I cannot add it to the index

What do you mean here?

Peter.

---

<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:46am UTC](https://discuss.elastic.co/t/exact-sort/6101/3 "2017-07-06T03:46:01Z")

</div>


