# Multi-index queries: ordering of results

**URL:** <https://discuss.elastic.co/t/multi-index-queries-ordering-of-results/14321>\
**Category:** Elasticsearch\
**Created:** [November 8, 2013, 9:11am UTC](https://discuss.elastic.co/t/multi-index-queries-ordering-of-results/14321 "2013-11-08T09:11:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Klaus\_Brunner](https://avatars.discourse-cdn.com/v4/letter/k/9fc29f/32.png) [@Klaus\_Brunner](https://discuss.elastic.co/u/Klaus_Brunner)\
**Post date:** [November 8, 2013, 9:11am UTC](https://discuss.elastic.co/t/multi-index-queries-ordering-of-results/14321/1 "2013-11-08T09:11:30Z")

</div>

Hi,

until at least ES 0.90.2, it appears that multi-index searches would  
reliably sort/group results in the order of the indices given. At list for  
filtered queries, which we've been using for a while. I've now switched to  
0.90.6 and this seems not to be the case any more. (Granted, it was never  
specified anywhere AFAIK.)

Is there any way to ensure a sorting order based on the index order given  
in the query, short of issuing separate single-index queries from the  
client?

Thanks,

Klaus

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 8, 2013, 10:46am UTC](https://discuss.elastic.co/t/multi-index-queries-ordering-of-results/14321/2 "2013-11-08T10:46:32Z")

</div>

Are you sure it was working as you described in 0.90.2?

Do you have any curl recreation we can replay on both versions?

That said, I guess you could perhaps add a sort on \_index field in addition to \_score? I 've never tested it though.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 8 nov. 2013 à 10:11, Klaus Brunner [klaus.brunner@gmail.com](mailto:klaus.brunner@gmail.com) a écrit :

Hi,

until at least ES 0.90.2, it appears that multi-index searches would reliably sort/group results in the order of the indices given. At list for filtered queries, which we've been using for a while. I've now switched to 0.90.6 and this seems not to be the case any more. (Granted, it was never specified anywhere AFAIK.)

Is there any way to ensure a sorting order based on the index order given in the query, short of issuing separate single-index queries from the client?

Thanks,

Klaus

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Klaus\_Brunner](https://avatars.discourse-cdn.com/v4/letter/k/9fc29f/32.png) [@Klaus\_Brunner](https://discuss.elastic.co/u/Klaus_Brunner)\
**Post date:** [November 8, 2013, 11:16am UTC](https://discuss.elastic.co/t/multi-index-queries-ordering-of-results/14321/3 "2013-11-08T11:16:15Z")

</div>

On Friday, 8 November 2013 11:46:32 UTC+1, David Pilato wrote:

> Are you sure it was working as you described in 0.90.2?

Yes, we have a unit test in place to check for this behaviour.

> Do you have any curl recreation we can replay on both versions?

I'll see that I provide one.

Thanks,

Klaus

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:08am UTC](https://discuss.elastic.co/t/multi-index-queries-ordering-of-results/14321/4 "2017-07-06T02:08:10Z")

</div>


