Creating index query


(hemant pahilwani) #1

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.

--


(Radu Gheorghe) #2

Hi,

You can use Thrift:
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:
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 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.

--


(Tanguy) #3

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

--


(David Pilato) #4

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

--

--


(hemant pahilwani) #5

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

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

--


(system) #6