=== Index Settings
There are many many knobs((("index settings"))) that you can twiddle to customize index behavior, which you can read about in the http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/_index_settings.html#_index_settings[Index Modules reference documentation], but...
TIP: Elasticsearch comes with good defaults. Don't twiddle these knobs until you understand what they do and why you should change them.
Two of the most important((("shards", "number_of_shards index setting")))((("number_of_shards setting")))((("index settings", "number_of_shards"))) settings are as follows:
number_of_shards
::
The number of primary shards that an index should have,
which defaults to `5`. This setting cannot be changed
after index creation.
number_of_replicas
::
The number of replica shards (copies) that each primary shard
should have, which defaults to `1`. This setting can be changed
at any time on a live index.
For instance, we could create a small index--just((("index settings", "number_of_replicas")))((("replica shards", "number_of_replicas index setting"))) one primary shard--and no replica shards with the following request:
PUT /my_temp_index { "settings": { "number_of_shards" : 1, "number_of_replicas" : 0 }
// SENSE: 070_Index_Mgmt/10_Settings.json
Later, we can change the number of replica shards dynamically using the
update-index-settings
API as((("update-index-settings API"))) follows:
PUT /my_temp_index/_settings { "number_of_replicas": 1
// SENSE: 070_Index_Mgmt/10_Settings.json