# Creating index query

**URL:** <https://discuss.elastic.co/t/creating-index-query/9343>\
**Category:** Elasticsearch\
**Created:** [October 12, 2012, 9:16pm UTC](https://discuss.elastic.co/t/creating-index-query/9343 "2012-10-12T21:16:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hemant\_pahilwani](https://avatars.discourse-cdn.com/v4/letter/h/f08c70/32.png) [@hemant\_pahilwani](https://discuss.elastic.co/u/hemant_pahilwani)\
**Post date:** [October 12, 2012, 9:16pm UTC](https://discuss.elastic.co/t/creating-index-query/9343/1 "2012-10-12T21:16:54Z")

</div>

Hi,

Is there any way to create index on server (with mappings) without using  
curl or java api? Is there any way in which i can add configuration to  
files of my elastic search server which will create index if it doesn't  
exist? the reason i need this is because access to env's through curl has  
been disabled and we have lot of indexes with numerous mapping that have to  
be created on 10 different environments.

Thanks.

--

---

<div class="post-metadata">

**Author:** ![Radu\_Gheorghe1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/radu_gheorghe1/32/2688_2.png) [@Radu\_Gheorghe1](https://discuss.elastic.co/u/Radu_Gheorghe1)\
**Post date:** [October 13, 2012, 11:31am UTC](https://discuss.elastic.co/t/creating-index-query/9343/2 "2012-10-13T11:31:50Z")

</div>

Hi,

You can use Thrift:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

By default, Elasticsearch creates an index if it doesn't exist. If you want  
them to be created with some specific mappings and settings, I suggest you  
use index templates:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

You can see there that you have the option of putting templates in your  
configuration directory. Please note that you don't need to restart  
Elasticsearch if you change a config template. When creating a new index,  
it will look at the template as it's defined at that point.

On Saturday, October 13, 2012 12:16:54 AM UTC+3, hemantp wrote:

> Hi,
> 
> Is there any way to create index on server (with mappings) without using  
> curl or java api? Is there any way in which i can add configuration to  
> files of my Elasticsearch server which will create index if it doesn't  
> exist? the reason i need this is because access to env's through curl has  
> been disabled and we have lot of indexes with numerous mapping that have to  
> be created on 10 different environments.
> 
> Thanks.

--

---

<div class="post-metadata">

**Author:** ![Tanguy1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tanguy1/32/1749_2.png) [@Tanguy1](https://discuss.elastic.co/u/Tanguy1)\
**Post date:** [October 15, 2012, 8:13am UTC](https://discuss.elastic.co/t/creating-index-query/9343/3 "2012-10-15T08:13:33Z")

</div>

You can also use ZeroMQ

> **[GitHub - tlrx/transport-zeromq: ØMQ transport layer plugin for Elasticsearch](https://github.com/tlrx/transport-zeromq)**
>
> ØMQ transport layer plugin for Elasticsearch. Contribute to tlrx/transport-zeromq development by creating an account on GitHub.

-- Tanguy

Le vendredi 12 octobre 2012 23:16:54 UTC+2, hemantp a écrit :

> Hi,
> 
> Is there any way to create index on server (with mappings) without using  
> curl or java api? Is there any way in which i can add configuration to  
> files of my Elasticsearch server which will create index if it doesn't  
> exist? the reason i need this is because access to env's through curl has  
> been disabled and we have lot of indexes with numerous mapping that have to  
> be created on 10 different environments.
> 
> Thanks.

--

---

<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:** [October 15, 2012, 8:30am UTC](https://discuss.elastic.co/t/creating-index-query/9343/4 "2012-10-15T08:30:31Z")

</div>

I don't know why you said without Java API, but in case of you are using Java, you can use the spring-elasticsearch project: [GitHub - dadoonet/spring-elasticsearch: Spring factories for elasticsearch](https://github.com/dadoonet/spring-elasticsearch)

It creates index, mappings, aliases, templates if needed each time you start the factory, just like hibernate does.  
Not sure it helps.

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

Le 15 oct. 2012 à 10:13, Tanguy [tlrx.dev@gmail.com](mailto:tlrx.dev@gmail.com) a écrit :

You can also use ZeroMQ

> **[GitHub - tlrx/transport-zeromq: ØMQ transport layer plugin for Elasticsearch](https://github.com/tlrx/transport-zeromq)**
>
> ØMQ transport layer plugin for Elasticsearch. Contribute to tlrx/transport-zeromq development by creating an account on GitHub.

-- Tanguy

Le vendredi 12 octobre 2012 23:16:54 UTC+2, hemantp a écrit :

> Hi,
> 
> Is there any way to create index on server (with mappings) without using curl or java api? Is there any way in which i can add configuration to files of my Elasticsearch server which will create index if it doesn't exist? the reason i need this is because access to env's through curl has been disabled and we have lot of indexes with numerous mapping that have to be created on 10 different environments.
> 
> Thanks.

--

--

---

<div class="post-metadata">

**Author:** ![hemant\_pahilwani](https://avatars.discourse-cdn.com/v4/letter/h/f08c70/32.png) [@hemant\_pahilwani](https://discuss.elastic.co/u/hemant_pahilwani)\
**Post date:** [October 15, 2012, 11:51pm UTC](https://discuss.elastic.co/t/creating-index-query/9343/5 "2012-10-15T23:51:40Z")

</div>

thanks radu, tanguy and david. all options suggested worked great. i  
decided to go with index templates as i needed configurations to reside on  
es package on servers.

On Saturday, October 13, 2012 4:31:50 AM UTC-7, Radu Gheorghe wrote:

> Hi,
> 
> You can use Thrift:  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/modules/thrift.html)
> 
> By default, Elasticsearch creates an index if it doesn't exist. If you  
> want them to be created with some specific mappings and settings, I suggest  
> you use index templates:
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html)
> 
> You can see there that you have the option of putting templates in your  
> configuration directory. Please note that you don't need to restart  
> Elasticsearch if you change a config template. When creating a new index,  
> it will look at the template as it's defined at that point.
> 
> On Saturday, October 13, 2012 12:16:54 AM UTC+3, hemantp wrote:
> 
> > Hi,
> > 
> > Is there any way to create index on server (with mappings) without using  
> > curl or java api? Is there any way in which i can add configuration to  
> > files of my Elasticsearch server which will create index if it doesn't  
> > exist? the reason i need this is because access to env's through curl has  
> > been disabled and we have lot of indexes with numerous mapping that have to  
> > be created on 10 different environments.
> > 
> > Thanks.

--

---

<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, 3:08am UTC](https://discuss.elastic.co/t/creating-index-query/9343/6 "2017-07-06T03:08:41Z")

</div>


