# Specific Indexes and Routing and Aliases and more using query DSL

**URL:** https://discuss.elastic.co/t/specific-indexes-and-routing-and-aliases-and-more-using-query-dsl/13505
**Category:** Elasticsearch
**Created:** [September 7, 2013, 5:31pm UTC](https://discuss.elastic.co/t/specific-indexes-and-routing-and-aliases-and-more-using-query-dsl/13505 "2013-09-07T17:31:07Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Bibin\_Abraham](https://avatars.discourse-cdn.com/v4/letter/b/4af34b/32.png) [@Bibin\_Abraham](https://discuss.elastic.co/u/Bibin_Abraham)
#### Post date: [September 7, 2013, 5:31pm UTC](https://discuss.elastic.co/t/specific-indexes-and-routing-and-aliases-and-more-using-query-dsl/13505/1 "2013-09-07T17:31:07Z")

</div>

1. I have 10 indexes in total and I want to search only in 4 indexes.Is it  
possible to search in specific indexes using query DSL?
2. What is the order followed when multiple indexes are queried?
3. Can we use index awareness attribute while querying?
4. Is it possible to query each index with the same routing value? Is it  
possible to specify routing using query DSL?
5. What is the limit for the number of aliases allowed in a cluster? Is it  
possible to specify alias using query DSL?
6. Is it possible to specify a range of documents for 'ids' DSL query? This  
will be help me point to the right documents inside a shard.

--  
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: ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)
#### Post date: [September 9, 2013, 7:27am UTC](https://discuss.elastic.co/t/specific-indexes-and-routing-and-aliases-and-more-using-query-dsl/13505/2 "2013-09-09T07:27:56Z")

</div>

Hi,

1). You can specify indices which indices to query via the url or via the  
indices query (  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/indices-query/))  
2) What order do you refer to?  
3) Yes, this can be done via the indices query mentioned in point 1.  
4) The routing value specified via the url is used in all indices you're  
querying.  
5) There is no ES limit, you can store many aliases in the cluster. You can  
use aliases in the query dsl.  
6) There is an ids query:  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/ids-query/)

On 7 September 2013 19:31, bin [bibin.abraham.dev@gmail.com](mailto:bibin.abraham.dev@gmail.com) wrote:

> 1. I have 10 indexes in total and I want to search only in 4 indexes.Is it  
> possible to search in specific indexes using query DSL?
> 2. What is the order followed when multiple indexes are queried?
> 3. Can we use index awareness attribute while querying?
> 4. Is it possible to query each index with the same routing value? Is it  
> possible to specify routing using query DSL?
> 5. What is the limit for the number of aliases allowed in a cluster? Is it  
> possible to specify alias using query DSL?
> 6. Is it possible to specify a range of documents for 'ids' DSL query?  
> This will be help me point to the right documents inside a shard.
> 
> --  
> 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).

--  
Met vriendelijke groet,

Martijn van Groningen

--  
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: ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)
#### Post date: [September 10, 2013, 7:10am UTC](https://discuss.elastic.co/t/specific-indexes-and-routing-and-aliases-and-more-using-query-dsl/13505/3 "2013-09-10T07:10:34Z")

</div>

> 1. Order - say i give [http://localhost:9200/index1,index2,index3?](http://localhost:9200/index1,index2,index3?).....  
> Will it first execute the query in index1 and then index2 and then index3?

No, it executes in parallel on all shards that belong to index1, 2, and 3.  
What is the reason behind this question?

> In my case, multiple apps might be using same cluster. So is the following  
> design correct:
> 
> Cluster Level Awareness - Handling Master Slave. Thus, clearly separating  
> it.

ES doesn't have a notion of master slave cluster awareness. There are  
primary and replica shards for read / write operations and there is an  
elected master that handles cluster wide administration.

> Index Level Awareness - Handling multiple apps as each entity will be a  
> separate index rather than each app as an index. This will help in  
> allocating proper primary shards for each index and scaling according to it.

Each application having its own index will allow you to tune the settings  
for each application need, this is valid design option.

> Routing - Handling organisation for apps

And routing can help you to keep data with a specific property within a  
shard, this allows you to keep search requests limited to only a few shards  
instead to all shards that belong to an index. Routing by organisation  
seems like a good property to use (assuming that it more or less partitions  
the data into even shards)

> If 'ids' range is supported, I can add each organisation as an alias with  
> the ids filter and a routing value

On the id field no numeric range is supported, since it is a string, if you  
want to query documents based on a numeric range you are free to add an  
additional number based field which you can use to execute a range filter  
or query.

--  
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:17am UTC](https://discuss.elastic.co/t/specific-indexes-and-routing-and-aliases-and-more-using-query-dsl/13505/4 "2017-07-06T02:17:22Z")

</div>


