# Unknown setting \[index.analysis\]

**URL:** <https://discuss.elastic.co/t/unknown-setting-index-analysis/137282>\
**Category:** Elasticsearch\
**Created:** [June 25, 2018, 2:47pm UTC](https://discuss.elastic.co/t/unknown-setting-index-analysis/137282 "2018-06-25T14:47:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fabio\_Marchetto](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fabio_marchetto/32/32655_2.png) [@Fabio\_Marchetto](https://discuss.elastic.co/u/Fabio_Marchetto)\
**Post date:** [June 25, 2018, 2:47pm UTC](https://discuss.elastic.co/t/unknown-setting-index-analysis/137282/1 "2018-06-25T14:47:37Z")

</div>

I'm creating my index with org.elasticsearch Java API (6.3.0) in the following function:

> private void createIndex(String type) throws IOException {  
> boolean existent =  
> config.getClient()  
> .admin()  
> .indices()  
> .prepareExists(CommonUtil.indexName(type))  
> .execute()  
> .actionGet()  
> .isExists();
> 
> ```
> if (!existent) {
> HashMap<String, Object> settings = new HashMap<>();
> 
> settings.put("number_of_shards", 1);
> settings.put("number_of_replicas", 1);
> 
> String analysis = "{ 'analyzer': { 'case_insensitive_sort': { 'type': 'custom', 'char_filter': [], 'filter': ['lowercase'] } } }";
> 
> CreateIndexRequestBuilder cirb = 
> config.getClient()
> .admin()
> .indices()
> .prepareCreate(CommonUtil.indexName(type))
> .setSettings(settings);
> 
> CreateIndexResponse createIndexResponse = cirb.execute().actionGet();
> 
> if (createIndexResponse != null && createIndexResponse.isAcknowledged()) {
> config.getClient()
> .admin()
> .indices()
> .prepareUpdateSettings(CommonUtil.indexName(type))
> .setSettings(Settings.builder().put("analysis", analysis)).get();
> } else {
> // Index creation failed
> }
> }
> 
> ```
> 
> }

This return me **javax.ejb.EJBException: java.lang.IllegalArgumentException: unknown setting [index.analysis] please check that any required plugins are installed, or check the breaking changes documentation for removed settings**. How can I init an analysis to implement case insensitive sort?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 25, 2018, 4:21pm UTC](https://discuss.elastic.co/t/unknown-setting-index-analysis/137282/2 "2018-06-25T16:21:08Z")

</div>

You can't pass that:

```auto
"{ 'analyzer': { 'case_insensitive_sort': { 'type': 'custom', 'char_filter': [], 'filter': ['lowercase'] } } }"

```

Within `.put("analysis", analysis)` method.

The REST Client has the following implementation: [https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/java-rest-high-create-index.html#\_providing\_the\_whole\_source](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/java-rest-high-create-index.html#_providing_the_whole_source)

Which can help you.

You should move away from the TransportClient as it will be removed in the future. But I believe the TransportClient has a similar method as the REST client. I did not check though.

---

<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:** [July 23, 2018, 4:21pm UTC](https://discuss.elastic.co/t/unknown-setting-index-analysis/137282/3 "2018-07-23T16:21:09Z")

</div>

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