# Spring + elastic 8.9.0 How to create index template

**URL:** <https://discuss.elastic.co/t/spring-elastic-8-9-0-how-to-create-index-template/340033>\
**Category:** Elasticsearch\
**Created:** [August 3, 2023, 10:05am UTC](https://discuss.elastic.co/t/spring-elastic-8-9-0-how-to-create-index-template/340033 "2023-08-03T10:05:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prasanth\_Gutlapalli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prasanth_gutlapalli/32/101405_2.png) [@Prasanth\_Gutlapalli](https://discuss.elastic.co/u/Prasanth_Gutlapalli)\
**Post date:** [August 3, 2023, 10:05am UTC](https://discuss.elastic.co/t/spring-elastic-8-9-0-how-to-create-index-template/340033/1 "2023-08-03T10:05:41Z")

</div>

How to create index template give java example

---

<div class="post-metadata">

**Author:** ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)\
**Post date:** [August 4, 2023, 2:59pm UTC](https://discuss.elastic.co/t/spring-elastic-8-9-0-how-to-create-index-template/340033/2 "2023-08-04T14:59:24Z")

</div>

Hi @Prasanth_Gutlapalli,

Welcome back! Are you using the [Elasticsearch Java Client](https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current/introduction.html) or [spring-data-elasticsearch](https://mvnrepository.com/artifact/org.springframework.data/spring-data-elasticsearch/5.1.2)?

---

<div class="post-metadata">

**Author:** ![Prasanth\_Gutlapalli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prasanth_gutlapalli/32/101405_2.png) [@Prasanth\_Gutlapalli](https://discuss.elastic.co/u/Prasanth_Gutlapalli)\
**Post date:** [August 4, 2023, 3:11pm UTC](https://discuss.elastic.co/t/spring-elastic-8-9-0-how-to-create-index-template/340033/3 "2023-08-04T15:11:41Z")

</div>

Hi, previous i used rest high level client now planning to Elasticsearch client

---

<div class="post-metadata">

**Author:** ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)\
**Post date:** [August 21, 2023, 1:09pm UTC](https://discuss.elastic.co/t/spring-elastic-8-9-0-how-to-create-index-template/340033/4 "2023-08-21T13:09:26Z")

</div>

Thanks for confirming @Prasanth_Gutlapalli. I've not found an explicit example with the latest Java client, but I think having a look at the [PutIndexTemplateRequest Javadoc](https://artifacts.elastic.co/javadoc/co/elastic/clients/elasticsearch-java/8.1.0/co/elastic/clients/elasticsearch/indices/PutIndexTemplateRequest.html) is probably a good place to start.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 18, 2023, 1:09pm UTC](https://discuss.elastic.co/t/spring-elastic-8-9-0-how-to-create-index-template/340033/5 "2023-09-18T13:09:31Z")

</div>

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