How to retrieve index template version number using High Level REST API

I am new to elasticsearch. I am looking for example how to retrieve index template version using HLRest API. I saw some posts indicating that this is not possible?

Hey @Cat, does this documentation about index template versioning answer your question?

Is there a solution where I can use it in conjunction with REST High Level call?

@Cat if you're referring to the Java high-level REST client, I believe the "Get Template" call will return a structure that should include the version field for the template you ask for:

I've tried both GetIndexRequest(...) and GetIndexTemplatesRequest(...). Both resulted in

2020-05-13 17:14:22.962  WARN 7 --- [nio-9991-exec-3] o.e.c.RestClient                         : request [GET http://<myES>/_template/documents_metadata_template?master_timeout=30s] returned 1 warnings: [299 Elasticsearch-6.8.7-c63e621 "[types removal] The parameter include_type_name should be explicitly specified in get template requests to prepare for 7.0. In 7.0 include_type_name will default to 'false', which means responses will omit the type name in mapping definitions."]

What do I need to set and where? Do you have an example of how to retrieve the version?

Thank you very much for your help,

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.