API to configure replica number and refresh interval?

Hello Elastic Search experts,

Is there an API to configure replica number and refresh interval? And also buffer % for indexing? Thanks.

thanks in advance,
Lin

For configuring the number of replicas see this:

https://www.elastic.co/guide/en/elasticsearch/guide/current/replica-shards.html?q=replica#replica-shards

See the following example for refresh_interval:

https://www.elastic.co/guide/en/elasticsearch/guide/current/near-real-time.html#CO36-2

indices.memory.index_buffer_size controls the buffer % for indexing:

https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-indices.html#buffer

However I don't recommend changing this and leaving the default (10%) as its usually a sane default. You can read the following blog which is a bit dated but has some useful information:

Thanks Mike!

Awesome answer. Have a good day.

regards,
Lin