LateCoder
LateCoder

Reputation: 2283

Trying to examine an index template from elasticsearch-python

I'm trying to look at the contents of an index template via the python elasticsearch API.

I do this:

es.get_template("_template/my_template")

But this is all I get back:

{'_id': '_template/my_template',
 'found': True,
 'lang': 'mustache',
 'template': 'my_template*'}

How can I get back the full template contents?

Upvotes: 0

Views: 2674

Answers (1)

Val
Val

Reputation: 217274

es.get_template() will retrieve a search template not an index template.

You need to use the es.indices client like this:

es.indices.get_template('my_template')

Upvotes: 2

Related Questions