# Multiple indices

**URL:** <https://discuss.elastic.co/t/multiple-indices/4453>\
**Category:** Elasticsearch\
**Created:** [May 21, 2011, 9:18am UTC](https://discuss.elastic.co/t/multiple-indices/4453 "2011-05-21T09:18:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Huy\_Phan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/huy_phan/32/1660_2.png) [@Huy\_Phan](https://discuss.elastic.co/u/Huy_Phan)\
**Post date:** [May 21, 2011, 9:18am UTC](https://discuss.elastic.co/t/multiple-indices/4453/1 "2011-05-21T09:18:38Z")

</div>

Hi all,  
I have been using Solr for a long time, they support multicore and  
configuration for each core is defined in xml files.  
I know that Elastic Search supports multiple indices and multiple  
types per index. From the document, I see that configuration for each  
index must be set through API. Is it possible to configure them in  
YAML or JSON configuration file, just like what Solr have done with  
multicore ?

Regards,  
Huy Phan

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 21, 2011, 2:07pm UTC](https://discuss.elastic.co/t/multiple-indices/4453/2 "2011-05-21T14:07:14Z")

</div>

In any case you need to use the API to create indices, so you can simply add the settings there. You can have index level configuration in the elasticsearch.(yml|json) under the index section, and that will be inherited by all indices created, but, custom settings will need to go through the API.  
On Saturday, May 21, 2011 at 12:18 PM, Huy Phan wrote:

> Hi all,  
> I have been using Solr for a long time, they support multicore and  
> configuration for each core is defined in xml files.  
> I know that Elastic Search supports multiple indices and multiple  
> types per index. From the document, I see that configuration for each  
> index must be set through API. Is it possible to configure them in  
> YAML or JSON configuration file, just like what Solr have done with  
> multicore ?
> 
> Regards,  
> Huy Phan

---

<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:** [May 21, 2011, 9:08pm UTC](https://discuss.elastic.co/t/multiple-indices/4453/3 "2011-05-21T21:08:48Z")

</div>

The good thing with ElasticSearch compared to Solr is that you create  
separate types and indices. also the replication + sharding setup is  
very easy (see below).

So just create one json (or mapping via API) for every document type.  
Then create indices on demand (either one index per type or you can  
also mix them into one index):

curl -XPUT "[http://localhost:9200/yourindex/](http://localhost:9200/yourindex/)" -d '  
index :  
number\_of\_shards : 3  
number\_of\_replicas : 1  
refresh\_interval : 10s  
'

---

<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, 4:05am UTC](https://discuss.elastic.co/t/multiple-indices/4453/4 "2017-07-06T04:05:38Z")

</div>

Closed on July 6, 2017, 4:05am UTC


