# Apply sort on specific index

**URL:** <https://discuss.elastic.co/t/apply-sort-on-specific-index/18582>\
**Category:** Elasticsearch\
**Created:** [July 10, 2014, 5:10pm UTC](https://discuss.elastic.co/t/apply-sort-on-specific-index/18582 "2014-07-10T17:10:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![navneet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/navneet/32/44881_2.png) [@navneet](https://discuss.elastic.co/u/navneet)\
**Post date:** [July 10, 2014, 5:10pm UTC](https://discuss.elastic.co/t/apply-sort-on-specific-index/18582/1 "2014-07-10T17:10:49Z")

</div>

Hi

I have two indexes on my setup - Index-A and Index-B. I want the results of the query to be sorted. The field on which I want to sort (say firstName.raw) is present in both the indexes.

My question - Is there a way by which I can sort results only from one of the indexes (say Index-A) ? I don't want to sort results form Index-B.

SideNote-1 : I wanted to do the same with filters as well. Which means, I wanted to apply the filter on a field only on results from one of the indexes. I was able to do this using Indices filter - [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-indices-filter.html#query-dsl-indices-filter](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-indices-filter.html#query-dsl-indices-filter). How can I do something similar for sorting ?

Thanks for your help!

Regards  
Navneet

---

<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, 1:16am UTC](https://discuss.elastic.co/t/apply-sort-on-specific-index/18582/2 "2017-07-06T01:16:44Z")

</div>


