Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"GET /_template{/temp*}" missing #34

Closed
jlecour opened this issue Feb 4, 2014 · 3 comments
Closed

"GET /_template{/temp*}" missing #34

jlecour opened this issue Feb 4, 2014 · 3 comments

Comments

@jlecour
Copy link

jlecour commented Feb 4, 2014

Hi,

It seems that elasticsearch-api is missing an action on indices templates : I can get all the templates by omitting the name parameter, or a specific template by setting name with its name, but I can't get templates matching a pattern (like template-*).

@karmi
Copy link
Contributor

karmi commented Feb 5, 2014

Can you point me to the relevant documentation on the .org site? (The API is based on the REST API spec.)

@jlecour
Copy link
Author

jlecour commented Feb 5, 2014

Hi Karel,

It's just there : http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-templates.html#getting in the 2nd code example of the paragraph.

I didn't know about the REST API spec. It's very interesting.

@karmi
Copy link
Contributor

karmi commented Mar 20, 2014

@jlecour This should work correctly:

client.indices.put_template name: 'template-1', body: { template: 'logs-*', settings: { 'index.number_of_shards' => 1 } }
client.indices.put_template name: 'template-2', body: { template: 'logs-*', settings: { 'index.number_of_replicas' => 0 } }

client.indices.get_template.keys
# ["marvel.monitor.prefix-.marvel", "template-1", "marvel", "marvel.monitor.marvel", "template-2"]

client.indices.get_template(name: 'temp*').keys
# => ["template-1", "template-2"]

@karmi karmi closed this as completed Mar 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants