Loading of index settings template from file in config/templates

Hi! Have anybody tried to load index settings template from file in
config/templates like described here
http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html? I'm
using v19.10 and it works for me only through http API e.g. url -XPUT
localhost:9200/_template/template_1 but not through file.

--

It seems to be working fine for me.

~/Software› curl -L -O
https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.10.tar.gz
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
100 14.5M 100 14.5M 0 0 1904k 0 0:00:07 0:00:07 --:--:--
2148k
~/Software› tar -xzf elasticsearch-0.19.10.tar.gz
~/Software› cd elasticsearch-0.19.10
~/Software/elasticsearch-0.19.10› cd config
~/Software/elasticsearch-0.19.10/config› mkdir templates
~/Software/elasticsearch-0.19.10/config› cd templates
~/Software/elasticsearch-0.19.10/config/templates› curl -L -O
https://raw.github.com/gist/425bc2a1a29c42f2d896/template1.json
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
103 414 103 414 0 0 707 0 --:--:-- --:--:-- --:--:--
6900
~/Software/elasticsearch-0.19.10/config/templates› cat template1.json
{
"template_1" : {
"template" : "*",
"settings" : {
"index.number_of_shards" : 2
},
"mappings" : {
"default" : {
"_source" : {
"enabled" : false
}
},
"type1" : {
"_all" : {
"enabled" : false
}
}
}
}
}
~/Software/elasticsearch-0.19.10/config/templates› cd ../..
~/Software/elasticsearch-0.19.10› bin/elasticsearch
~/Software/elasticsearch-0.19.10› curl -XPUT localhost:9200/new_index &&
echo
{"ok":true,"acknowledged":true}
~/Software/elasticsearch-0.19.10› curl -XGET
"localhost:9200/new_index/_settings?pretty=true" && echo
{
"new_index" : {
"settings" : {
"index.number_of_shards" : "2",
"index.number_of_replicas" : "1",
"index.version.created" : "191099"
}
}
}
~/Software/elasticsearch-0.19.10› curl -XGET
"localhost:9200/new_index/_mapping?pretty=true" && echo
{
"new_index" : {
"type1" : {
"_all" : {
"enabled" : false
},
"_source" : {
"enabled" : false
},
"properties" : { }
},
"default" : {
"_source" : {
"enabled" : false
},
"properties" : { }
}
}
}

Did you copy this file to all master-eligible nodes?

On Tuesday, November 6, 2012 10:39:13 AM UTC-5, Serg Pilipenko wrote:

Hi! Have anybody tried to load index settings template from file in
config/templates like described here
http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html? I'm
using v19.10 and it works for me only through http API e.g. url -XPUT
localhost:9200/_template/template_1 but not through file.

--

This template can also have analysis configuration?

On Tuesday, November 6, 2012 10:04:32 PM UTC-2, Igor Motov wrote:

It seems to be working fine for me.

~/Software› curl -L -O
https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.10.tar.gz
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
100 14.5M 100 14.5M 0 0 1904k 0 0:00:07 0:00:07 --:--:--
2148k
~/Software› tar -xzf elasticsearch-0.19.10.tar.gz
~/Software› cd elasticsearch-0.19.10
~/Software/elasticsearch-0.19.10› cd config
~/Software/elasticsearch-0.19.10/config› mkdir templates
~/Software/elasticsearch-0.19.10/config› cd templates
~/Software/elasticsearch-0.19.10/config/templates› curl -L -O
https://raw.github.com/gist/425bc2a1a29c42f2d896/template1.json
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
103 414 103 414 0 0 707 0 --:--:-- --:--:-- --:--:--
6900
~/Software/elasticsearch-0.19.10/config/templates› cat template1.json
{
"template_1" : {
"template" : "*",
"settings" : {
"index.number_of_shards" : 2
},
"mappings" : {
"default" : {
"_source" : {
"enabled" : false
}
},
"type1" : {
"_all" : {
"enabled" : false
}
}
}
}
}
~/Software/elasticsearch-0.19.10/config/templates› cd ../..
~/Software/elasticsearch-0.19.10› bin/elasticsearch
~/Software/elasticsearch-0.19.10› curl -XPUT localhost:9200/new_index &&
echo
{"ok":true,"acknowledged":true}
~/Software/elasticsearch-0.19.10› curl -XGET
"localhost:9200/new_index/_settings?pretty=true" && echo
{
"new_index" : {
"settings" : {
"index.number_of_shards" : "2",
"index.number_of_replicas" : "1",
"index.version.created" : "191099"
}
}
}
~/Software/elasticsearch-0.19.10› curl -XGET
"localhost:9200/new_index/_mapping?pretty=true" && echo
{
"new_index" : {
"type1" : {
"_all" : {
"enabled" : false
},
"_source" : {
"enabled" : false
},
"properties" : { }
},
"default" : {
"_source" : {
"enabled" : false
},
"properties" : { }
}
}
}

Did you copy this file to all master-eligible nodes?

On Tuesday, November 6, 2012 10:39:13 AM UTC-5, Serg Pilipenko wrote:

Hi! Have anybody tried to load index settings template from file in
config/templates like described here
http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html? I'm
using v19.10 and it works for me only through http API e.g. url -XPUT
localhost:9200/_template/template_1 but not through file.

--

Sure. Analysis configuration is just settings and mappings after all. You
can also define custom analyzers in config/elasticsearch.yml and refer to
them in template mappings.

On Tuesday, November 6, 2012 7:46:31 PM UTC-5, Rogerio Pereira wrote:

This template can also have analysis configuration?

On Tuesday, November 6, 2012 10:04:32 PM UTC-2, Igor Motov wrote:

It seems to be working fine for me.

~/Software› curl -L -O
https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.10.tar.gz
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
100 14.5M 100 14.5M 0 0 1904k 0 0:00:07 0:00:07 --:--:--
2148k
~/Software› tar -xzf elasticsearch-0.19.10.tar.gz
~/Software› cd elasticsearch-0.19.10
~/Software/elasticsearch-0.19.10› cd config
~/Software/elasticsearch-0.19.10/config› mkdir templates
~/Software/elasticsearch-0.19.10/config› cd templates
~/Software/elasticsearch-0.19.10/config/templates› curl -L -O
https://raw.github.com/gist/425bc2a1a29c42f2d896/template1.json
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
103 414 103 414 0 0 707 0 --:--:-- --:--:-- --:--:--
6900
~/Software/elasticsearch-0.19.10/config/templates› cat template1.json
{
"template_1" : {
"template" : "*",
"settings" : {
"index.number_of_shards" : 2
},
"mappings" : {
"default" : {
"_source" : {
"enabled" : false
}
},
"type1" : {
"_all" : {
"enabled" : false
}
}
}
}
}
~/Software/elasticsearch-0.19.10/config/templates› cd ../..
~/Software/elasticsearch-0.19.10› bin/elasticsearch
~/Software/elasticsearch-0.19.10› curl -XPUT localhost:9200/new_index &&
echo
{"ok":true,"acknowledged":true}
~/Software/elasticsearch-0.19.10› curl -XGET
"localhost:9200/new_index/_settings?pretty=true" && echo
{
"new_index" : {
"settings" : {
"index.number_of_shards" : "2",
"index.number_of_replicas" : "1",
"index.version.created" : "191099"
}
}
}
~/Software/elasticsearch-0.19.10› curl -XGET
"localhost:9200/new_index/_mapping?pretty=true" && echo
{
"new_index" : {
"type1" : {
"_all" : {
"enabled" : false
},
"_source" : {
"enabled" : false
},
"properties" : { }
},
"default" : {
"_source" : {
"enabled" : false
},
"properties" : { }
}
}
}

Did you copy this file to all master-eligible nodes?

On Tuesday, November 6, 2012 10:39:13 AM UTC-5, Serg Pilipenko wrote:

Hi! Have anybody tried to load index settings template from file in
config/templates like described here
http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html? I'm
using v19.10 and it works for me only through http API e.g. url -XPUT
localhost:9200/_template/template_1 but not through file.

--

Serg Pilipenko wrote:

Have anybody tried to load index settings template from file in
config/templates like described here
http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html?
I'm using v19.10 and it works for me only through http API e.g. url
-XPUT localhost:9200/_template/template_1 but not through file.

I verified that this works. How many nodes in your cluster? Perhaps
you didn't put the file in the config/ of the current master (where
index creation happens).

-Drew

You are right, it works for me to.

So I've found my mistake. When I've tried to use option -Des.config
or -Des.path.config or -Des.config.path it stops searching templates
in -Des.path.home and not able to find it in -Des.config
or -Des.path.config or -Des.config.path. I've tried to specify different
paths here but not success.

The right combination in this case is:
-Des.path.home #application location
-Des.path.config=/another/etc/elasticsearch/config
-Des.config=/another/etc/elasticsearch/config/elasticsearch.json

dir -R etc/elasticsearch
etc/elasticsearch:
config logging.json

etc/elasticsearch/config:
elasticsearch.json templates

etc/elasticsearch/config/templates:
template_1.json

This is really trivial but without clear doc I've stuck with guessing of
this variables and paths.

среда, 7 ноября 2012 г., 1:04:32 UTC+1 пользователь Igor Motov написал:

It seems to be working fine for me.

~/Software› curl -L -O
https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.10.tar.gz
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
100 14.5M 100 14.5M 0 0 1904k 0 0:00:07 0:00:07 --:--:--
2148k
~/Software› tar -xzf elasticsearch-0.19.10.tar.gz
~/Software› cd elasticsearch-0.19.10
~/Software/elasticsearch-0.19.10› cd config
~/Software/elasticsearch-0.19.10/config› mkdir templates
~/Software/elasticsearch-0.19.10/config› cd templates
~/Software/elasticsearch-0.19.10/config/templates› curl -L -O
https://raw.github.com/gist/425bc2a1a29c42f2d896/template1.json
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
103 414 103 414 0 0 707 0 --:--:-- --:--:-- --:--:--
6900
~/Software/elasticsearch-0.19.10/config/templates› cat template1.json
{
"template_1" : {
"template" : "*",
"settings" : {
"index.number_of_shards" : 2
},
"mappings" : {
"default" : {
"_source" : {
"enabled" : false
}
},
"type1" : {
"_all" : {
"enabled" : false
}
}
}
}
}
~/Software/elasticsearch-0.19.10/config/templates› cd ../..
~/Software/elasticsearch-0.19.10› bin/elasticsearch
~/Software/elasticsearch-0.19.10› curl -XPUT localhost:9200/new_index &&
echo
{"ok":true,"acknowledged":true}
~/Software/elasticsearch-0.19.10› curl -XGET
"localhost:9200/new_index/_settings?pretty=true" && echo
{
"new_index" : {
"settings" : {
"index.number_of_shards" : "2",
"index.number_of_replicas" : "1",
"index.version.created" : "191099"
}
}
}
~/Software/elasticsearch-0.19.10› curl -XGET
"localhost:9200/new_index/_mapping?pretty=true" && echo
{
"new_index" : {
"type1" : {
"_all" : {
"enabled" : false
},
"_source" : {
"enabled" : false
},
"properties" : { }
},
"default" : {
"_source" : {
"enabled" : false
},
"properties" : { }
}
}
}

Did you copy this file to all master-eligible nodes?

On Tuesday, November 6, 2012 10:39:13 AM UTC-5, Serg Pilipenko wrote:

Hi! Have anybody tried to load index settings template from file in
config/templates like described here
http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html? I'm
using v19.10 and it works for me only through http API e.g. url -XPUT
localhost:9200/_template/template_1 but not through file.

--

So I've made mistake again.
ES don't recognize config/templates/* in place another than -Des.path.home
Or I'm doing something wrong.

среда, 7 ноября 2012 г., 15:43:56 UTC+1 пользователь Serg Pilipenko написал:

You are right, it works for me to.

So I've found my mistake. When I've tried to use option -Des.config
or -Des.path.config or -Des.config.path it stops searching templates
in -Des.path.home and not able to find it in -Des.config
or -Des.path.config or -Des.config.path. I've tried to specify different
paths here but not success.

The right combination in this case is:
-Des.path.home #application location
-Des.path.config=/another/etc/elasticsearch/config
-Des.config=/another/etc/elasticsearch/config/elasticsearch.json

dir -R etc/elasticsearch
etc/elasticsearch:
config logging.json

etc/elasticsearch/config:
elasticsearch.json templates

etc/elasticsearch/config/templates:
template_1.json

This is really trivial but without clear doc I've stuck with guessing of
this variables and paths.

среда, 7 ноября 2012 г., 1:04:32 UTC+1 пользователь Igor Motov написал:

It seems to be working fine for me.

~/Software› curl -L -O
https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.10.tar.gz
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
100 14.5M 100 14.5M 0 0 1904k 0 0:00:07 0:00:07 --:--:--
2148k
~/Software› tar -xzf elasticsearch-0.19.10.tar.gz
~/Software› cd elasticsearch-0.19.10
~/Software/elasticsearch-0.19.10› cd config
~/Software/elasticsearch-0.19.10/config› mkdir templates
~/Software/elasticsearch-0.19.10/config› cd templates
~/Software/elasticsearch-0.19.10/config/templates› curl -L -O
https://raw.github.com/gist/425bc2a1a29c42f2d896/template1.json
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
103 414 103 414 0 0 707 0 --:--:-- --:--:-- --:--:--
6900
~/Software/elasticsearch-0.19.10/config/templates› cat template1.json
{
"template_1" : {
"template" : "*",
"settings" : {
"index.number_of_shards" : 2
},
"mappings" : {
"default" : {
"_source" : {
"enabled" : false
}
},
"type1" : {
"_all" : {
"enabled" : false
}
}
}
}
}
~/Software/elasticsearch-0.19.10/config/templates› cd ../..
~/Software/elasticsearch-0.19.10› bin/elasticsearch
~/Software/elasticsearch-0.19.10› curl -XPUT localhost:9200/new_index &&
echo
{"ok":true,"acknowledged":true}
~/Software/elasticsearch-0.19.10› curl -XGET
"localhost:9200/new_index/_settings?pretty=true" && echo
{
"new_index" : {
"settings" : {
"index.number_of_shards" : "2",
"index.number_of_replicas" : "1",
"index.version.created" : "191099"
}
}
}
~/Software/elasticsearch-0.19.10› curl -XGET
"localhost:9200/new_index/_mapping?pretty=true" && echo
{
"new_index" : {
"type1" : {
"_all" : {
"enabled" : false
},
"_source" : {
"enabled" : false
},
"properties" : { }
},
"default" : {
"_source" : {
"enabled" : false
},
"properties" : { }
}
}
}

Did you copy this file to all master-eligible nodes?

On Tuesday, November 6, 2012 10:39:13 AM UTC-5, Serg Pilipenko wrote:

Hi! Have anybody tried to load index settings template from file in
config/templates like described here
http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html? I'm
using v19.10 and it works for me only through http API e.g. url -XPUT
localhost:9200/_template/template_1 but not through file.

--

It should be -Des.path.conf=...

On Wednesday, November 7, 2012 11:44:59 AM UTC-5, Serg Pilipenko wrote:

So I've made mistake again.
ES don't recognize config/templates/* in place another than -Des.path.home
Or I'm doing something wrong.

среда, 7 ноября 2012 г., 15:43:56 UTC+1 пользователь Serg Pilipenko
написал:

You are right, it works for me to.

So I've found my mistake. When I've tried to use option -Des.config
or -Des.path.config or -Des.config.path it stops searching templates
in -Des.path.home and not able to find it in -Des.config
or -Des.path.config or -Des.config.path. I've tried to specify different
paths here but not success.

The right combination in this case is:
-Des.path.home #application location
-Des.path.config=/another/etc/elasticsearch/config
-Des.config=/another/etc/elasticsearch/config/elasticsearch.json

dir -R etc/elasticsearch
etc/elasticsearch:
config logging.json

etc/elasticsearch/config:
elasticsearch.json templates

etc/elasticsearch/config/templates:
template_1.json

This is really trivial but without clear doc I've stuck with guessing of
this variables and paths.

среда, 7 ноября 2012 г., 1:04:32 UTC+1 пользователь Igor Motov написал:

It seems to be working fine for me.

~/Software› curl -L -O
https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.10.tar.gz
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
100 14.5M 100 14.5M 0 0 1904k 0 0:00:07 0:00:07 --:--:--
2148k
~/Software› tar -xzf elasticsearch-0.19.10.tar.gz
~/Software› cd elasticsearch-0.19.10
~/Software/elasticsearch-0.19.10› cd config
~/Software/elasticsearch-0.19.10/config› mkdir templates
~/Software/elasticsearch-0.19.10/config› cd templates
~/Software/elasticsearch-0.19.10/config/templates› curl -L -O
https://raw.github.com/gist/425bc2a1a29c42f2d896/template1.json
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
103 414 103 414 0 0 707 0 --:--:-- --:--:-- --:--:--
6900
~/Software/elasticsearch-0.19.10/config/templates› cat template1.json
{
"template_1" : {
"template" : "*",
"settings" : {
"index.number_of_shards" : 2
},
"mappings" : {
"default" : {
"_source" : {
"enabled" : false
}
},
"type1" : {
"_all" : {
"enabled" : false
}
}
}
}
}
~/Software/elasticsearch-0.19.10/config/templates› cd ../..
~/Software/elasticsearch-0.19.10› bin/elasticsearch
~/Software/elasticsearch-0.19.10› curl -XPUT localhost:9200/new_index &&
echo
{"ok":true,"acknowledged":true}
~/Software/elasticsearch-0.19.10› curl -XGET
"localhost:9200/new_index/_settings?pretty=true" && echo
{
"new_index" : {
"settings" : {
"index.number_of_shards" : "2",
"index.number_of_replicas" : "1",
"index.version.created" : "191099"
}
}
}
~/Software/elasticsearch-0.19.10› curl -XGET
"localhost:9200/new_index/_mapping?pretty=true" && echo
{
"new_index" : {
"type1" : {
"_all" : {
"enabled" : false
},
"_source" : {
"enabled" : false
},
"properties" : { }
},
"default" : {
"_source" : {
"enabled" : false
},
"properties" : { }
}
}
}

Did you copy this file to all master-eligible nodes?

On Tuesday, November 6, 2012 10:39:13 AM UTC-5, Serg Pilipenko wrote:

Hi! Have anybody tried to load index settings template from file in
config/templates like described here
http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html? I'm
using v19.10 and it works for me only through http API e.g. url -XPUT
localhost:9200/_template/template_1 but not through file.

--

Thanks! Now really works. It should be fixed in the doc here
http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html

"path.conf" but not "path.config"

среда, 7 ноября 2012 г., 18:40:10 UTC+1 пользователь Igor Motov написал:

It should be -Des.path.conf=...

On Wednesday, November 7, 2012 11:44:59 AM UTC-5, Serg Pilipenko wrote:

So I've made mistake again.
ES don't recognize config/templates/* in place another than -Des.path.home
Or I'm doing something wrong.

среда, 7 ноября 2012 г., 15:43:56 UTC+1 пользователь Serg Pilipenko
написал:

You are right, it works for me to.

So I've found my mistake. When I've tried to use option -Des.config
or -Des.path.config or -Des.config.path it stops searching templates
in -Des.path.home and not able to find it in -Des.config
or -Des.path.config or -Des.config.path. I've tried to specify different
paths here but not success.

The right combination in this case is:
-Des.path.home #application location
-Des.path.config=/another/etc/elasticsearch/config
-Des.config=/another/etc/elasticsearch/config/elasticsearch.json

dir -R etc/elasticsearch
etc/elasticsearch:
config logging.json

etc/elasticsearch/config:
elasticsearch.json templates

etc/elasticsearch/config/templates:
template_1.json

This is really trivial but without clear doc I've stuck with guessing of
this variables and paths.

среда, 7 ноября 2012 г., 1:04:32 UTC+1 пользователь Igor Motov написал:

It seems to be working fine for me.

~/Software› curl -L -O
https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.10.tar.gz
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
100 14.5M 100 14.5M 0 0 1904k 0 0:00:07 0:00:07
--:--:-- 2148k
~/Software› tar -xzf elasticsearch-0.19.10.tar.gz
~/Software› cd elasticsearch-0.19.10
~/Software/elasticsearch-0.19.10› cd config
~/Software/elasticsearch-0.19.10/config› mkdir templates
~/Software/elasticsearch-0.19.10/config› cd templates
~/Software/elasticsearch-0.19.10/config/templates› curl -L -O
https://raw.github.com/gist/425bc2a1a29c42f2d896/template1.json
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
103 414 103 414 0 0 707 0 --:--:-- --:--:--
--:--:-- 6900
~/Software/elasticsearch-0.19.10/config/templates› cat template1.json
{
"template_1" : {
"template" : "*",
"settings" : {
"index.number_of_shards" : 2
},
"mappings" : {
"default" : {
"_source" : {
"enabled" : false
}
},
"type1" : {
"_all" : {
"enabled" : false
}
}
}
}
}
~/Software/elasticsearch-0.19.10/config/templates› cd ../..
~/Software/elasticsearch-0.19.10› bin/elasticsearch
~/Software/elasticsearch-0.19.10› curl -XPUT localhost:9200/new_index
&& echo
{"ok":true,"acknowledged":true}
~/Software/elasticsearch-0.19.10› curl -XGET
"localhost:9200/new_index/_settings?pretty=true" && echo
{
"new_index" : {
"settings" : {
"index.number_of_shards" : "2",
"index.number_of_replicas" : "1",
"index.version.created" : "191099"
}
}
}
~/Software/elasticsearch-0.19.10› curl -XGET
"localhost:9200/new_index/_mapping?pretty=true" && echo
{
"new_index" : {
"type1" : {
"_all" : {
"enabled" : false
},
"_source" : {
"enabled" : false
},
"properties" : { }
},
"default" : {
"_source" : {
"enabled" : false
},
"properties" : { }
}
}
}

Did you copy this file to all master-eligible nodes?

On Tuesday, November 6, 2012 10:39:13 AM UTC-5, Serg Pilipenko wrote:

Hi! Have anybody tried to load index settings template from file in
config/templates like described here
http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html? I'm
using v19.10 and it works for me only through http API e.g. url -XPUT
localhost:9200/_template/template_1 but not through file.

--

Fixed! Thanks for pointing it out. I didn't notice that it was
"path.config" on this page.

On Wednesday, November 7, 2012 1:43:32 PM UTC-5, Serg Pilipenko wrote:

Thanks! Now really works. It should be fixed in the doc here
http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html

"path.conf" but not "path.config"

среда, 7 ноября 2012 г., 18:40:10 UTC+1 пользователь Igor Motov написал:

It should be -Des.path.conf=...

On Wednesday, November 7, 2012 11:44:59 AM UTC-5, Serg Pilipenko wrote:

So I've made mistake again.
ES don't recognize config/templates/* in place another
than -Des.path.home
Or I'm doing something wrong.

среда, 7 ноября 2012 г., 15:43:56 UTC+1 пользователь Serg Pilipenko
написал:

You are right, it works for me to.

So I've found my mistake. When I've tried to use option -Des.config
or -Des.path.config or -Des.config.path it stops searching templates
in -Des.path.home and not able to find it in -Des.config
or -Des.path.config or -Des.config.path. I've tried to specify different
paths here but not success.

The right combination in this case is:
-Des.path.home #application location
-Des.path.config=/another/etc/elasticsearch/config
-Des.config=/another/etc/elasticsearch/config/elasticsearch.json

dir -R etc/elasticsearch
etc/elasticsearch:
config logging.json

etc/elasticsearch/config:
elasticsearch.json templates

etc/elasticsearch/config/templates:
template_1.json

This is really trivial but without clear doc I've stuck with guessing
of this variables and paths.

среда, 7 ноября 2012 г., 1:04:32 UTC+1 пользователь Igor Motov написал:

It seems to be working fine for me.

~/Software› curl -L -O
https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.10.tar.gz
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
100 14.5M 100 14.5M 0 0 1904k 0 0:00:07 0:00:07
--:--:-- 2148k
~/Software› tar -xzf elasticsearch-0.19.10.tar.gz
~/Software› cd elasticsearch-0.19.10
~/Software/elasticsearch-0.19.10› cd config
~/Software/elasticsearch-0.19.10/config› mkdir templates
~/Software/elasticsearch-0.19.10/config› cd templates
~/Software/elasticsearch-0.19.10/config/templates› curl -L -O
https://raw.github.com/gist/425bc2a1a29c42f2d896/template1.json
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
103 414 103 414 0 0 707 0 --:--:-- --:--:--
--:--:-- 6900
~/Software/elasticsearch-0.19.10/config/templates› cat template1.json
{
"template_1" : {
"template" : "*",
"settings" : {
"index.number_of_shards" : 2
},
"mappings" : {
"default" : {
"_source" : {
"enabled" : false
}
},
"type1" : {
"_all" : {
"enabled" : false
}
}
}
}
}
~/Software/elasticsearch-0.19.10/config/templates› cd ../..
~/Software/elasticsearch-0.19.10› bin/elasticsearch
~/Software/elasticsearch-0.19.10› curl -XPUT localhost:9200/new_index
&& echo
{"ok":true,"acknowledged":true}
~/Software/elasticsearch-0.19.10› curl -XGET
"localhost:9200/new_index/_settings?pretty=true" && echo
{
"new_index" : {
"settings" : {
"index.number_of_shards" : "2",
"index.number_of_replicas" : "1",
"index.version.created" : "191099"
}
}
}
~/Software/elasticsearch-0.19.10› curl -XGET
"localhost:9200/new_index/_mapping?pretty=true" && echo
{
"new_index" : {
"type1" : {
"_all" : {
"enabled" : false
},
"_source" : {
"enabled" : false
},
"properties" : { }
},
"default" : {
"_source" : {
"enabled" : false
},
"properties" : { }
}
}
}

Did you copy this file to all master-eligible nodes?

On Tuesday, November 6, 2012 10:39:13 AM UTC-5, Serg Pilipenko wrote:

Hi! Have anybody tried to load index settings template from file in
config/templates like described here
http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html? I'm
using v19.10 and it works for me only through http API e.g. url -XPUT
localhost:9200/_template/template_1 but not through file.

--

hi
when i try your steps i would expect to be able to GET template info as
well, however this command doesnt bring anything:
curl -XGET "localhost:9200/_template/template_1" && echo

im trying to confirm that my template is loading successfully from config
file, but i dont really know how
thanks

On Wednesday, 7 November 2012 11:04:32 UTC+11, Igor Motov wrote:

It seems to be working fine for me.

~/Software› curl -L -O
https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.10.tar.gz
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
100 14.5M 100 14.5M 0 0 1904k 0 0:00:07 0:00:07 --:--:--
2148k
~/Software› tar -xzf elasticsearch-0.19.10.tar.gz
~/Software› cd elasticsearch-0.19.10
~/Software/elasticsearch-0.19.10› cd config
~/Software/elasticsearch-0.19.10/config› mkdir templates
~/Software/elasticsearch-0.19.10/config› cd templates
~/Software/elasticsearch-0.19.10/config/templates› curl -L -O
https://raw.github.com/gist/425bc2a1a29c42f2d896/template1.json
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
103 414 103 414 0 0 707 0 --:--:-- --:--:-- --:--:--
6900
~/Software/elasticsearch-0.19.10/config/templates› cat template1.json
{
"template_1" : {
"template" : "*",
"settings" : {
"index.number_of_shards" : 2
},
"mappings" : {
"default" : {
"_source" : {
"enabled" : false
}
},
"type1" : {
"_all" : {
"enabled" : false
}
}
}
}
}
~/Software/elasticsearch-0.19.10/config/templates› cd ../..
~/Software/elasticsearch-0.19.10› bin/elasticsearch
~/Software/elasticsearch-0.19.10› curl -XPUT localhost:9200/new_index &&
echo
{"ok":true,"acknowledged":true}
~/Software/elasticsearch-0.19.10› curl -XGET
"localhost:9200/new_index/_settings?pretty=true" && echo
{
"new_index" : {
"settings" : {
"index.number_of_shards" : "2",
"index.number_of_replicas" : "1",
"index.version.created" : "191099"
}
}
}
~/Software/elasticsearch-0.19.10› curl -XGET
"localhost:9200/new_index/_mapping?pretty=true" && echo
{
"new_index" : {
"type1" : {
"_all" : {
"enabled" : false
},
"_source" : {
"enabled" : false
},
"properties" : { }
},
"default" : {
"_source" : {
"enabled" : false
},
"properties" : { }
}
}
}

Did you copy this file to all master-eligible nodes?

On Tuesday, November 6, 2012 10:39:13 AM UTC-5, Serg Pilipenko wrote:

Hi! Have anybody tried to load index settings template from file in
config/templates like described here
http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html? I'm
using v19.10 and it works for me only through http API e.g. url -XPUT
localhost:9200/_template/template_1 but not through file.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

This command only returns templates that were added using

curl -XPOST "localhost:9200/_template/...."

and doesn't include templates specified in the config/templates directory.

On Thursday, April 18, 2013 8:24:30 AM UTC-4, gondo wrote:

hi
when i try your steps i would expect to be able to GET template info as
well, however this command doesnt bring anything:
curl -XGET "localhost:9200/_template/template_1" && echo

im trying to confirm that my template is loading successfully from config
file, but i dont really know how
thanks

On Wednesday, 7 November 2012 11:04:32 UTC+11, Igor Motov wrote:

It seems to be working fine for me.

~/Software› curl -L -O
https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.10.tar.gz
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
100 14.5M 100 14.5M 0 0 1904k 0 0:00:07 0:00:07 --:--:--
2148k
~/Software› tar -xzf elasticsearch-0.19.10.tar.gz
~/Software› cd elasticsearch-0.19.10
~/Software/elasticsearch-0.19.10› cd config
~/Software/elasticsearch-0.19.10/config› mkdir templates
~/Software/elasticsearch-0.19.10/config› cd templates
~/Software/elasticsearch-0.19.10/config/templates› curl -L -O
https://raw.github.com/gist/425bc2a1a29c42f2d896/template1.json
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
103 414 103 414 0 0 707 0 --:--:-- --:--:-- --:--:--
6900
~/Software/elasticsearch-0.19.10/config/templates› cat template1.json
{
"template_1" : {
"template" : "*",
"settings" : {
"index.number_of_shards" : 2
},
"mappings" : {
"default" : {
"_source" : {
"enabled" : false
}
},
"type1" : {
"_all" : {
"enabled" : false
}
}
}
}
}
~/Software/elasticsearch-0.19.10/config/templates› cd ../..
~/Software/elasticsearch-0.19.10› bin/elasticsearch
~/Software/elasticsearch-0.19.10› curl -XPUT localhost:9200/new_index &&
echo
{"ok":true,"acknowledged":true}
~/Software/elasticsearch-0.19.10› curl -XGET
"localhost:9200/new_index/_settings?pretty=true" && echo
{
"new_index" : {
"settings" : {
"index.number_of_shards" : "2",
"index.number_of_replicas" : "1",
"index.version.created" : "191099"
}
}
}
~/Software/elasticsearch-0.19.10› curl -XGET
"localhost:9200/new_index/_mapping?pretty=true" && echo
{
"new_index" : {
"type1" : {
"_all" : {
"enabled" : false
},
"_source" : {
"enabled" : false
},
"properties" : { }
},
"default" : {
"_source" : {
"enabled" : false
},
"properties" : { }
}
}
}

Did you copy this file to all master-eligible nodes?

On Tuesday, November 6, 2012 10:39:13 AM UTC-5, Serg Pilipenko wrote:

Hi! Have anybody tried to load index settings template from file in
config/templates like described here
http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html? I'm
using v19.10 and it works for me only through http API e.g. url -XPUT
localhost:9200/_template/template_1 but not through file.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

hmm so there is no way to confirm that templates set in configuration
were successfully parsed?

On Wednesday, 7 November 2012 02:39:13 UTC+11, Serg Pilipenko wrote:

Hi! Have anybody tried to load index settings template from file in
config/templates like described here
http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html? I'm
using v19.10 and it works for me only through http API e.g. url -XPUT
localhost:9200/_template/template_1 but not through file.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Try creating an index and check the log files on master for errors.

On Wednesday, April 24, 2013 2:24:14 PM UTC+2, gondo wrote:

hmm so there is no way to confirm that templates set in configuration
were successfully parsed?

On Wednesday, 7 November 2012 02:39:13 UTC+11, Serg Pilipenko wrote:

Hi! Have anybody tried to load index settings template from file in
config/templates like described here
http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html? I'm
using v19.10 and it works for me only through http API e.g. url -XPUT
localhost:9200/_template/template_1 but not through file.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.