index-modules.asciidoc 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. [[index-modules]]
  2. = Index modules
  3. [partintro]
  4. --
  5. Index Modules are modules created per index and control all aspects related to
  6. an index.
  7. [float]
  8. [[index-modules-settings]]
  9. == Index Settings
  10. Index level settings can be set per-index. Settings may be:
  11. _static_::
  12. They can only be set at index creation time or on a
  13. <<indices-open-close,closed index>>.
  14. _dynamic_::
  15. They can be changed on a live index using the
  16. <<indices-update-settings,update-index-settings>> API.
  17. WARNING: Changing static or dynamic index settings on a closed index could
  18. result in incorrect settings that are impossible to rectify without deleting
  19. and recreating the index.
  20. [float]
  21. === Static index settings
  22. Below is a list of all _static_ index settings that are not associated with any
  23. specific index module:
  24. `index.number_of_shards`::
  25. The number of primary shards that an index should have. Defaults to 5.
  26. This setting can only be set at index creation time. It cannot be
  27. changed on a closed index. Note: the number of shards are limited to `1024` per
  28. index. This limitation is a safety limit to prevent accidental creation of indices
  29. that can destabilize a cluster due to resource allocation. The limit can be modified
  30. by specifying `export ES_JAVA_OPTS="-Des.index.max_number_of_shards=128"` system property on every node that is
  31. part of the cluster.
  32. `index.shard.check_on_startup`::
  33. +
  34. --
  35. Whether or not shards should be checked for corruption before opening. When
  36. corruption is detected, it will prevent the shard from being opened. Accepts:
  37. `false`::
  38. (default) Don't check for corruption when opening a shard.
  39. `checksum`::
  40. Check for physical corruption.
  41. `true`::
  42. Check for both physical and logical corruption. This is much more
  43. expensive in terms of CPU and memory usage.
  44. WARNING: Expert only. Checking shards may take a lot of time on large indices.
  45. --
  46. [[index-codec]] `index.codec`::
  47. The +default+ value compresses stored data with LZ4
  48. compression, but this can be set to +best_compression+
  49. which uses https://en.wikipedia.org/wiki/DEFLATE[DEFLATE] for a higher
  50. compression ratio, at the expense of slower stored fields performance.
  51. If you are updating the compression type, the new one will be applied
  52. after segments are merged. Segment merging can be forced using
  53. <<indices-forcemerge,force merge>>.
  54. [[routing-partition-size]] `index.routing_partition_size`::
  55. The number of shards a custom <<mapping-routing-field,routing>> value can go to.
  56. Defaults to 1 and can only be set at index creation time. This value must be less
  57. than the `index.number_of_shards` unless the `index.number_of_shards` value is also 1.
  58. See <<routing-index-partition>> for more details about how this setting is used.
  59. [float]
  60. [[dynamic-index-settings]]
  61. === Dynamic index settings
  62. Below is a list of all _dynamic_ index settings that are not associated with any
  63. specific index module:
  64. `index.number_of_replicas`::
  65. The number of replicas each primary shard has. Defaults to 1.
  66. `index.auto_expand_replicas`::
  67. Auto-expand the number of replicas based on the number of data nodes in the cluster.
  68. Set to a dash delimited lower and upper bound (e.g. `0-5`) or use `all`
  69. for the upper bound (e.g. `0-all`). Defaults to `false` (i.e. disabled).
  70. Note that the auto-expanded number of replicas does not take any other allocation
  71. rules into account, such as <<allocation-awareness,shard allocation awareness>>,
  72. <<shard-allocation-filtering,filtering>> or <<allocation-total-shards,total shards per node>>,
  73. and this can lead to the cluster health becoming `YELLOW` if the applicable rules
  74. prevent all the replicas from being allocated.
  75. `index.search.idle.after`::
  76. How long a shard can not receive a search or get request until it's considered
  77. search idle. (default is `30s`)
  78. `index.refresh_interval`::
  79. How often to perform a refresh operation, which makes recent changes to the
  80. index visible to search. Defaults to `1s`. Can be set to `-1` to disable
  81. refresh. If this setting is not explicitly set, shards that haven't seen
  82. search traffic for at least `index.search.idle.after` seconds will not receive
  83. background refreshes until they receive a search request. Searches that hit an
  84. idle shard where a refresh is pending will wait for the next background
  85. refresh (within `1s`). This behavior aims to automatically optimize bulk
  86. indexing in the default case when no searches are performed. In order to opt
  87. out of this behavior an explicit value of `1s` should set as the refresh
  88. interval.
  89. `index.max_result_window`::
  90. The maximum value of `from + size` for searches to this index. Defaults to
  91. `10000`. Search requests take heap memory and time proportional to
  92. `from + size` and this limits that memory. See
  93. <<search-request-scroll,Scroll>> or <<search-request-search-after,Search After>> for a more efficient alternative
  94. to raising this.
  95. `index.max_inner_result_window`::
  96. The maximum value of `from + size` for inner hits definition and top hits aggregations to this index. Defaults to
  97. `100`. Inner hits and top hits aggregation take heap memory and time proportional to `from + size` and this limits that memory.
  98. `index.max_rescore_window`::
  99. The maximum value of `window_size` for `rescore` requests in searches of this index.
  100. Defaults to `index.max_result_window` which defaults to `10000`. Search
  101. requests take heap memory and time proportional to
  102. `max(window_size, from + size)` and this limits that memory.
  103. `index.max_docvalue_fields_search`::
  104. The maximum number of `docvalue_fields` that are allowed in a query.
  105. Defaults to `100`. Doc-value fields are costly since they might incur
  106. a per-field per-document seek.
  107. `index.max_script_fields`::
  108. The maximum number of `script_fields` that are allowed in a query.
  109. Defaults to `32`.
  110. `index.max_ngram_diff`::
  111. The maximum allowed difference between min_gram and max_gram for NGramTokenizer and NGramTokenFilter.
  112. Defaults to `1`.
  113. `index.max_shingle_diff`::
  114. The maximum allowed difference between max_shingle_size and min_shingle_size for ShingleTokenFilter.
  115. Defaults to `3`.
  116. `index.blocks.read_only`::
  117. Set to `true` to make the index and index metadata read only, `false` to
  118. allow writes and metadata changes.
  119. `index.blocks.read_only_allow_delete`::
  120. Identical to `index.blocks.read_only` but allows deleting the index to free
  121. up resources.
  122. `index.blocks.read`::
  123. Set to `true` to disable read operations against the index.
  124. `index.blocks.write`::
  125. Set to `true` to disable data write operations against the index. Unlike `read_only`,
  126. this setting does not affect metadata. For instance, you can close an index with a `write`
  127. block, but not an index with a `read_only` block.
  128. `index.blocks.metadata`::
  129. Set to `true` to disable index metadata reads and writes.
  130. `index.max_refresh_listeners`::
  131. Maximum number of refresh listeners available on each shard of the index.
  132. These listeners are used to implement <<docs-refresh,`refresh=wait_for`>>.
  133. `index.analyze.max_token_count`::
  134. The maximum number of tokens that can be produced using _analyze API.
  135. Defaults to `10000`.
  136. `index.highlight.max_analyzed_offset`::
  137. The maximum number of characters that will be analyzed for a highlight request.
  138. This setting is only applicable when highlighting is requested on a text that was indexed without offsets or term vectors.
  139. Defaults to `1000000`.
  140. `index.max_terms_count`::
  141. The maximum number of terms that can be used in Terms Query.
  142. Defaults to `65536`.
  143. `index.max_regex_length`::
  144. The maximum length of regex that can be used in Regexp Query.
  145. Defaults to `1000`.
  146. `index.routing.allocation.enable`::
  147. Controls shard allocation for this index. It can be set to:
  148. * `all` (default) - Allows shard allocation for all shards.
  149. * `primaries` - Allows shard allocation only for primary shards.
  150. * `new_primaries` - Allows shard allocation only for newly-created primary shards.
  151. * `none` - No shard allocation is allowed.
  152. `index.routing.rebalance.enable`::
  153. Enables shard rebalancing for this index. It can be set to:
  154. * `all` (default) - Allows shard rebalancing for all shards.
  155. * `primaries` - Allows shard rebalancing only for primary shards.
  156. * `replicas` - Allows shard rebalancing only for replica shards.
  157. * `none` - No shard rebalancing is allowed.
  158. `index.gc_deletes`::
  159. The length of time that a <<delete-versioning,deleted document's version number>> remains available for <<index-versioning,further versioned operations>>.
  160. Defaults to `60s`.
  161. [float]
  162. === Settings in other index modules
  163. Other index settings are available in index modules:
  164. <<analysis,Analysis>>::
  165. Settings to define analyzers, tokenizers, token filters and character
  166. filters.
  167. <<index-modules-allocation,Index shard allocation>>::
  168. Control over where, when, and how shards are allocated to nodes.
  169. <<index-modules-mapper,Mapping>>::
  170. Enable or disable dynamic mapping for an index.
  171. <<index-modules-merge,Merging>>::
  172. Control over how shards are merged by the background merge process.
  173. <<index-modules-similarity,Similarities>>::
  174. Configure custom similarity settings to customize how search results are
  175. scored.
  176. <<index-modules-slowlog,Slowlog>>::
  177. Control over how slow queries and fetch requests are logged.
  178. <<index-modules-store,Store>>::
  179. Configure the type of filesystem used to access shard data.
  180. <<index-modules-translog,Translog>>::
  181. Control over the transaction log and background flush operations.
  182. --
  183. include::index-modules/analysis.asciidoc[]
  184. include::index-modules/allocation.asciidoc[]
  185. include::index-modules/mapper.asciidoc[]
  186. include::index-modules/merge.asciidoc[]
  187. include::index-modules/similarity.asciidoc[]
  188. include::index-modules/slowlog.asciidoc[]
  189. include::index-modules/store.asciidoc[]
  190. include::index-modules/translog.asciidoc[]
  191. include::index-modules/index-sorting.asciidoc[]