Creating New indices keeps using the default configuration

We have defined a certain configuration for creating new indices from our application, (number of shards, and number of replicas), however, when checking the newly created indices on production we found that they are created using the default ES configurations (5 shards , 1 replica) and that results always on having yellow cluster status due to having unsigned shards.


How? Using index templates?

No we create the indices by hitting http requests from with in our code, and we add the needed configurations as a JSON to the request body as follows :

"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 0

This looks good. I suspect the application is not correctly sending the settings when creating the index.

How do you create the indices? Using which client library?

we use org.apache.commons.httpclient

I think you can enable log in debug level and checks that the request sent are conforming with what elasticsearch expects (