I had @Document(shards=5) for my entity in my SpringBoot application using Spring Data Elasticsearch. I have realised it is too resource consuming and have reduced it to @Document(shards=1) and just redeployed the java app with new code. I did no action on ElasticSearch side.
Should the Jest client do all the best to reduce the number of shard used, or it should be done by myself being Elasticsearch admin?
Spring Data Elasticsearch uses this information when creating the index; it it not reapplied to change parameters like the numner of shards. So what you want to do is not possible with Spring Data Elasticsearch.
If you can afford to drop the data and have a possibility to reload it, then delete the index, restart your program with the changed
@Documentannotation and reload the data.If you cannot simply reload the data, you can do the following directly in Elasticsearch (for the exact commands please refer to the Elasticsearch docs):
@Documentannotation to use the new index.