# 7.10 RestHighLevelClient - Composable Index Template and Component Template APIs difficult to use

**URL:** <https://discuss.elastic.co/t/7-10-resthighlevelclient-composable-index-template-and-component-template-apis-difficult-to-use/263097>\
**Category:** Elasticsearch\
**Created:** [February 3, 2021, 8:41am UTC](https://discuss.elastic.co/t/7-10-resthighlevelclient-composable-index-template-and-component-template-apis-difficult-to-use/263097 "2021-02-03T08:41:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rajath\_H\_G](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajath_h_g/32/81933_2.png) [@Rajath\_H\_G](https://discuss.elastic.co/u/Rajath_H_G)\
**Post date:** [February 3, 2021, 8:41am UTC](https://discuss.elastic.co/t/7-10-resthighlevelclient-composable-index-template-and-component-template-apis-difficult-to-use/263097/1 "2021-02-03T08:41:47Z")

</div>

I am planning to migrate from legacy templates to Composable Templates introduced in 7.x.

But with Composable Templates we don't have APIs to feed complete template request string directly or build one using XContentBuilder and supply that as input, unlike in PutIndexTemplateRequest

For ex:

public PutIndexTemplateRequest source(String templateSource, XContentType xContentType);

public PutIndexTemplateRequest source(XContentBuilder templateBuilder);

Component Templates also have similar shortcomings.

I could see similar concern has been reported earlier

> <https://github.com/elastic/elasticsearch/issues/60750#issue-673597846>
>
> I currently use the legacy IndexTemplates with the "inheritance" mechanism.
> During runtime, my application, will read in plain JSON templates from the...

And this has been addressed by providing Builder methods. But its also not very convenient for all the use cases.

We have been extensively using ES licensed version in our project and wanted to know if there are any easier ways to creating templates (just by supplying JSON string).

Thanks !

---

<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:** [March 3, 2021, 8:42am UTC](https://discuss.elastic.co/t/7-10-resthighlevelclient-composable-index-template-and-component-template-apis-difficult-to-use/263097/2 "2021-03-03T08:42:15Z")

</div>

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