Creating index query

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.

--

Hi,

You can use Thrift:

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:

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.

--

You can also use ZeroMQ

-- 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.

--

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

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

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

Le 15 oct. 2012 à 10:13, Tanguy tlrx.dev@gmail.com a écrit :

You can also use ZeroMQ

-- 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.

--

--

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

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

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.

--