# Composable Index template with java REST

**URL:** https://discuss.elastic.co/t/composable-index-template-with-java-rest/341634
**Category:** Elasticsearch
**Created:** [August 24, 2023, 11:13pm UTC](https://discuss.elastic.co/t/composable-index-template-with-java-rest/341634 "2023-08-24T23:13:35Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![linkerc](https://avatars.discourse-cdn.com/v4/letter/l/13edae/32.png) [@linkerc](https://discuss.elastic.co/u/linkerc)
#### Post date: [August 24, 2023, 11:13pm UTC](https://discuss.elastic.co/t/composable-index-template-with-java-rest/341634/1 "2023-08-24T23:13:36Z")

</div>

I'm running 7.15 so it's not the latest binary code.

How do I add sorting index in setting?

> **[Create or update composable index template API | Java REST Client \[7.17\] |...](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/java-rest-high-put-index-template-v2.html#_settings_2)**

I'm getting invalid sort order error. It seems composable index only takes builder for settings; therefore, I convert all values to string.  
The Settings builder doesn't seem to have a put() method for ArrayList, so I assume converting to string is the right thing to do.

Any suggestions?

The composable index template seems much harder to work with comparing to the legacy template where I can simply pass in a map for both settings and mappings.

---

<div class="post-metadata">

### Author: ![linkerc](https://avatars.discourse-cdn.com/v4/letter/l/13edae/32.png) [@linkerc](https://discuss.elastic.co/u/linkerc)
#### Post date: [August 25, 2023, 5:25pm UTC](https://discuss.elastic.co/t/composable-index-template-with-java-rest/341634/2 "2023-08-25T17:25:28Z")

</div>

Never mind.  
There's builder.putList() that works.

---

<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 22, 2023, 5:25pm UTC](https://discuss.elastic.co/t/composable-index-template-with-java-rest/341634/3 "2023-09-22T17:25:41Z")

</div>

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