# How can I sort results by \_id?

**URL:** https://discuss.elastic.co/t/how-can-i-sort-results-by--id/21656
**Category:** Elasticsearch
**Created:** [January 15, 2015, 9:35am UTC](https://discuss.elastic.co/t/how-can-i-sort-results-by--id/21656 "2015-01-15T09:35:26Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Jason\_Zhang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jason_zhang/32/745_2.png) [@Jason\_Zhang](https://discuss.elastic.co/u/Jason_Zhang)
#### Post date: [January 15, 2015, 9:35am UTC](https://discuss.elastic.co/t/how-can-i-sort-results-by--id/21656/1 "2015-01-15T09:35:26Z")

</div>

I use a query dsl like:

{  
"filter": {  
"exists": { "field": "info" }  
},  
"sort": { "\_id": "desc" }  
}

And the "\_id" here is an integer like '123'.

But the result is like:

{  
"took": 50,  
...  
"hits": {  
...  
"hits": [  
{  
...  
"sort": [null]  
}]  
}  
}

Also, I've tried to add "\_id": { "index": "not\_analyzerd" } in the \_mapping.  
This time the "sort" section returns values. But I find the results are  
still partly unordered.

Can I sort results by \_id? How?

Thank you.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/4ea45f18-847a-4b58-b78e-ddcd9ee1e9f9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4ea45f18-847a-4b58-b78e-ddcd9ee1e9f9%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)
#### Post date: [January 15, 2015, 9:48am UTC](https://discuss.elastic.co/t/how-can-i-sort-results-by--id/21656/2 "2015-01-15T09:48:41Z")

</div>

Making it index:not\_analyzed should work, what is the issue with the  
results?

Note that loading the \_id in fielddata is typically very costly since the  
\_id field is typically unique per document.

On Thu, Jan 15, 2015 at 10:35 AM, Jason Zhang [mock2u@gmail.com](mailto:mock2u@gmail.com) wrote:

> I use a query dsl like:
> 
> {  
> "filter": {  
> "exists": { "field": "info" }  
> },  
> "sort": { "\_id": "desc" }  
> }
> 
> And the "\_id" here is an integer like '123'.
> 
> But the result is like:
> 
> {  
> "took": 50,  
> ...  
> "hits": {  
> ...  
> "hits": [  
> {  
> ...  
> "sort": [null]  
> }]  
> }  
> }
> 
> Also, I've tried to add "\_id": { "index": "not\_analyzerd" } in the  
> \_mapping.  
> This time the "sort" section returns values. But I find the results are  
> still partly unordered.
> 
> Can I sort results by \_id? How?
> 
> Thank you.
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/4ea45f18-847a-4b58-b78e-ddcd9ee1e9f9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4ea45f18-847a-4b58-b78e-ddcd9ee1e9f9%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/4ea45f18-847a-4b58-b78e-ddcd9ee1e9f9%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/4ea45f18-847a-4b58-b78e-ddcd9ee1e9f9%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
Adrien Grand

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j7uK%2BJY\_2-C3LHGTc7YYRFVv2z\_-o%3DuWbDhE2SQOJYFZA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j7uK%2BJY_2-C3LHGTc7YYRFVv2z_-o%3DuWbDhE2SQOJYFZA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Jason\_Zhang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jason_zhang/32/745_2.png) [@Jason\_Zhang](https://discuss.elastic.co/u/Jason_Zhang)
#### Post date: [January 15, 2015, 10:04am UTC](https://discuss.elastic.co/t/how-can-i-sort-results-by--id/21656/3 "2015-01-15T10:04:35Z")

</div>

What I'm confused is the 'sorted' results are still partly unordered.

Also, if I query:

{ "range": {  
"\_id": {  
"gt": "10000",  
"lt": "19999"}}}

the results contain "\_id": 199989.

On Thursday, January 15, 2015 at 5:48:48 PM UTC+8, Adrien Grand wrote:

> Making it index:not\_analyzed should work, what is the issue with the  
> results?
> 
> Note that loading the \_id in fielddata is typically very costly since the  
> \_id field is typically unique per document.
> 
> On Thu, Jan 15, 2015 at 10:35 AM, Jason Zhang \<[moc...@gmail.com](mailto:moc...@gmail.com)  
> \<javascript:\>\> wrote:
> 
> > I use a query dsl like:
> > 
> > {  
> > "filter": {  
> > "exists": { "field": "info" }  
> > },  
> > "sort": { "\_id": "desc" }  
> > }
> > 
> > And the "\_id" here is an integer like '123'.
> > 
> > But the result is like:
> > 
> > {  
> > "took": 50,  
> > ...  
> > "hits": {  
> > ...  
> > "hits": [  
> > {  
> > ...  
> > "sort": [null]  
> > }]  
> > }  
> > }
> > 
> > Also, I've tried to add "\_id": { "index": "not\_analyzerd" } in the  
> > \_mapping.  
> > This time the "sort" section returns values. But I find the results are  
> > still partly unordered.
> > 
> > Can I sort results by \_id? How?
> > 
> > Thank you.
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/4ea45f18-847a-4b58-b78e-ddcd9ee1e9f9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4ea45f18-847a-4b58-b78e-ddcd9ee1e9f9%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/4ea45f18-847a-4b58-b78e-ddcd9ee1e9f9%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/4ea45f18-847a-4b58-b78e-ddcd9ee1e9f9%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> Adrien Grand

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/b7f625dd-8afd-4603-afc8-1fd6d5b601d1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b7f625dd-8afd-4603-afc8-1fd6d5b601d1%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)
#### Post date: [January 15, 2015, 10:07am UTC](https://discuss.elastic.co/t/how-can-i-sort-results-by--id/21656/4 "2015-01-15T10:07:16Z")

</div>

This is because the \_id is a string field, so comparison is based on the  
lexicographical order, not numeric.

On Thu, Jan 15, 2015 at 11:04 AM, Jason Zhang [mock2u@gmail.com](mailto:mock2u@gmail.com) wrote:

> What I'm confused is the 'sorted' results are still partly unordered.
> 
> Also, if I query:
> 
> { "range": {  
> "\_id": {  
> "gt": "10000",  
> "lt": "19999"}}}
> 
> the results contain "\_id": 199989.
> 
> On Thursday, January 15, 2015 at 5:48:48 PM UTC+8, Adrien Grand wrote:
> 
> > Making it index:not\_analyzed should work, what is the issue with the  
> > results?
> > 
> > Note that loading the \_id in fielddata is typically very costly since the  
> > \_id field is typically unique per document.
> > 
> > On Thu, Jan 15, 2015 at 10:35 AM, Jason Zhang [moc...@gmail.com](mailto:moc...@gmail.com) wrote:
> > 
> > > I use a query dsl like:
> > > 
> > > {  
> > > "filter": {  
> > > "exists": { "field": "info" }  
> > > },  
> > > "sort": { "\_id": "desc" }  
> > > }
> > > 
> > > And the "\_id" here is an integer like '123'.
> > > 
> > > But the result is like:
> > > 
> > > {  
> > > "took": 50,  
> > > ...  
> > > "hits": {  
> > > ...  
> > > "hits": [  
> > > {  
> > > ...  
> > > "sort": [null]  
> > > }]  
> > > }  
> > > }
> > > 
> > > Also, I've tried to add "\_id": { "index": "not\_analyzerd" } in the  
> > > \_mapping.  
> > > This time the "sort" section returns values. But I find the results are  
> > > still partly unordered.
> > > 
> > > Can I sort results by \_id? How?
> > > 
> > > Thank you.
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google  
> > > Groups "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send  
> > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > msgid/elasticsearch/4ea45f18-847a-4b58-b78e-ddcd9ee1e9f9%  
> > > [40googlegroups.com](http://40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/4ea45f18-847a-4b58-b78e-ddcd9ee1e9f9%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/4ea45f18-847a-4b58-b78e-ddcd9ee1e9f9%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > Adrien Grand
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/b7f625dd-8afd-4603-afc8-1fd6d5b601d1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b7f625dd-8afd-4603-afc8-1fd6d5b601d1%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/b7f625dd-8afd-4603-afc8-1fd6d5b601d1%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/b7f625dd-8afd-4603-afc8-1fd6d5b601d1%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
Adrien Grand

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j6x\_GN9HuZzYtgB\_T69hu0y\_QVUCzqxxOKciEvKubgkUw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j6x_GN9HuZzYtgB_T69hu0y_QVUCzqxxOKciEvKubgkUw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Jason\_Zhang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jason_zhang/32/745_2.png) [@Jason\_Zhang](https://discuss.elastic.co/u/Jason_Zhang)
#### Post date: [January 15, 2015, 10:12am UTC](https://discuss.elastic.co/t/how-can-i-sort-results-by--id/21656/5 "2015-01-15T10:12:05Z")

</div>

Can I specify its type as integer in \_mapping? Because the \_id I use is  
rewritten.

On Thursday, January 15, 2015 at 6:07:22 PM UTC+8, Adrien Grand wrote:

> This is because the \_id is a string field, so comparison is based on the  
> lexicographical order, not numeric.
> 
> On Thu, Jan 15, 2015 at 11:04 AM, Jason Zhang \<[moc...@gmail.com](mailto:moc...@gmail.com)  
> \<javascript:\>\> wrote:
> 
> > What I'm confused is the 'sorted' results are still partly unordered.
> > 
> > Also, if I query:
> > 
> > { "range": {  
> > "\_id": {  
> > "gt": "10000",  
> > "lt": "19999"}}}
> > 
> > the results contain "\_id": 199989.
> > 
> > On Thursday, January 15, 2015 at 5:48:48 PM UTC+8, Adrien Grand wrote:
> > 
> > > Making it index:not\_analyzed should work, what is the issue with the  
> > > results?
> > > 
> > > Note that loading the \_id in fielddata is typically very costly since  
> > > the \_id field is typically unique per document.
> > > 
> > > On Thu, Jan 15, 2015 at 10:35 AM, Jason Zhang [moc...@gmail.com](mailto:moc...@gmail.com) wrote:
> > > 
> > > > I use a query dsl like:
> > > > 
> > > > {  
> > > > "filter": {  
> > > > "exists": { "field": "info" }  
> > > > },  
> > > > "sort": { "\_id": "desc" }  
> > > > }
> > > > 
> > > > And the "\_id" here is an integer like '123'.
> > > > 
> > > > But the result is like:
> > > > 
> > > > {  
> > > > "took": 50,  
> > > > ...  
> > > > "hits": {  
> > > > ...  
> > > > "hits": [  
> > > > {  
> > > > ...  
> > > > "sort": [null]  
> > > > }]  
> > > > }  
> > > > }
> > > > 
> > > > Also, I've tried to add "\_id": { "index": "not\_analyzerd" } in the  
> > > > \_mapping.  
> > > > This time the "sort" section returns values. But I find the results are  
> > > > still partly unordered.
> > > > 
> > > > Can I sort results by \_id? How?
> > > > 
> > > > Thank you.
> > > > 
> > > > --  
> > > > You received this message because you are subscribed to the Google  
> > > > Groups "elasticsearch" group.  
> > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > msgid/elasticsearch/4ea45f18-847a-4b58-b78e-ddcd9ee1e9f9%  
> > > > [40googlegroups.com](http://40googlegroups.com)  
> > > > [https://groups.google.com/d/msgid/elasticsearch/4ea45f18-847a-4b58-b78e-ddcd9ee1e9f9%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/4ea45f18-847a-4b58-b78e-ddcd9ee1e9f9%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > .  
> > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > 
> > > --  
> > > Adrien Grand
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/b7f625dd-8afd-4603-afc8-1fd6d5b601d1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b7f625dd-8afd-4603-afc8-1fd6d5b601d1%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/b7f625dd-8afd-4603-afc8-1fd6d5b601d1%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/b7f625dd-8afd-4603-afc8-1fd6d5b601d1%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> Adrien Grand

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/2475cb1a-5631-4b06-8507-28c4d81f9d4d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2475cb1a-5631-4b06-8507-28c4d81f9d4d%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Itamar\_Syn\_Hershko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itamar_syn_hershko/32/725_2.png) [@Itamar\_Syn\_Hershko](https://discuss.elastic.co/u/Itamar_Syn_Hershko)
#### Post date: [January 15, 2015, 10:13am UTC](https://discuss.elastic.co/t/how-can-i-sort-results-by--id/21656/6 "2015-01-15T10:13:35Z")

</div>

No, an ID has to be a string

--

Itamar Syn-Hershko  
[http://code972.com](http://code972.com) | @synhershko [https://twitter.com/synhershko](https://twitter.com/synhershko)  
Freelance Developer & Consultant  
Author of RavenDB in Action [http://manning.com/synhershko/](http://manning.com/synhershko/)

On Thu, Jan 15, 2015 at 12:12 PM, Jason Zhang [mock2u@gmail.com](mailto:mock2u@gmail.com) wrote:

> Can I specify its type as integer in \_mapping? Because the \_id I use is  
> rewritten.
> 
> On Thursday, January 15, 2015 at 6:07:22 PM UTC+8, Adrien Grand wrote:
> 
> > This is because the \_id is a string field, so comparison is based on the  
> > lexicographical order, not numeric.
> > 
> > On Thu, Jan 15, 2015 at 11:04 AM, Jason Zhang [moc...@gmail.com](mailto:moc...@gmail.com) wrote:
> > 
> > > What I'm confused is the 'sorted' results are still partly unordered.
> > > 
> > > Also, if I query:
> > > 
> > > { "range": {  
> > > "\_id": {  
> > > "gt": "10000",  
> > > "lt": "19999"}}}
> > > 
> > > the results contain "\_id": 199989.
> > > 
> > > On Thursday, January 15, 2015 at 5:48:48 PM UTC+8, Adrien Grand wrote:
> > > 
> > > > Making it index:not\_analyzed should work, what is the issue with the  
> > > > results?
> > > > 
> > > > Note that loading the \_id in fielddata is typically very costly since  
> > > > the \_id field is typically unique per document.
> > > > 
> > > > On Thu, Jan 15, 2015 at 10:35 AM, Jason Zhang [moc...@gmail.com](mailto:moc...@gmail.com) wrote:
> > > > 
> > > > > I use a query dsl like:
> > > > > 
> > > > > {  
> > > > > "filter": {  
> > > > > "exists": { "field": "info" }  
> > > > > },  
> > > > > "sort": { "\_id": "desc" }  
> > > > > }
> > > > > 
> > > > > And the "\_id" here is an integer like '123'.
> > > > > 
> > > > > But the result is like:
> > > > > 
> > > > > {  
> > > > > "took": 50,  
> > > > > ...  
> > > > > "hits": {  
> > > > > ...  
> > > > > "hits": [  
> > > > > {  
> > > > > ...  
> > > > > "sort": [null]  
> > > > > }]  
> > > > > }  
> > > > > }
> > > > > 
> > > > > Also, I've tried to add "\_id": { "index": "not\_analyzerd" } in the  
> > > > > \_mapping.  
> > > > > This time the "sort" section returns values. But I find the results  
> > > > > are still partly unordered.
> > > > > 
> > > > > Can I sort results by \_id? How?
> > > > > 
> > > > > Thank you.
> > > > > 
> > > > > --  
> > > > > You received this message because you are subscribed to the Google  
> > > > > Groups "elasticsearch" group.  
> > > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > > msgid/elasticsearch/4ea45f18-847a-4b58-b78e-ddcd9ee1e9f9%40goo  
> > > > > [glegroups.com](http://glegroups.com)  
> > > > > [https://groups.google.com/d/msgid/elasticsearch/4ea45f18-847a-4b58-b78e-ddcd9ee1e9f9%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/4ea45f18-847a-4b58-b78e-ddcd9ee1e9f9%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > .  
> > > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > > 
> > > > --  
> > > > Adrien Grand
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google  
> > > Groups "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send  
> > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > msgid/elasticsearch/b7f625dd-8afd-4603-afc8-1fd6d5b601d1%  
> > > [40googlegroups.com](http://40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/b7f625dd-8afd-4603-afc8-1fd6d5b601d1%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/b7f625dd-8afd-4603-afc8-1fd6d5b601d1%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .
> > > 
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > Adrien Grand
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/2475cb1a-5631-4b06-8507-28c4d81f9d4d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2475cb1a-5631-4b06-8507-28c4d81f9d4d%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/2475cb1a-5631-4b06-8507-28c4d81f9d4d%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/2475cb1a-5631-4b06-8507-28c4d81f9d4d%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZvWQtGKE6JDd6%3D%2BXRJENrAyLPkTE3%2BBRpFsEJ%2BS09bTpg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZvWQtGKE6JDd6%3D%2BXRJENrAyLPkTE3%2BBRpFsEJ%2BS09bTpg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:38am UTC](https://discuss.elastic.co/t/how-can-i-sort-results-by--id/21656/7 "2017-07-06T00:38:45Z")

</div>


