index-modules.asciidoc 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  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. [discrete]
  8. [[index-modules-settings]]
  9. == Index Settings
  10. [[index-modules-settings-description]]
  11. // tag::index-modules-settings-description-tag[]
  12. Index level settings can be set per-index. Settings may be:
  13. _static_::
  14. They can only be set at index creation time or on a
  15. <<indices-open-close,closed index>>.
  16. _dynamic_::
  17. They can be changed on a live index using the
  18. <<indices-update-settings,update-index-settings>> API.
  19. // end::index-modules-settings-description-tag[]
  20. WARNING: Changing static or dynamic index settings on a closed index could
  21. result in incorrect settings that are impossible to rectify without deleting
  22. and recreating the index.
  23. [discrete]
  24. === Static index settings
  25. Below is a list of all _static_ index settings that are not associated with any
  26. specific index module:
  27. [[index-number-of-shards]]
  28. // tag::index-number-of-shards-tag[]
  29. `index.number_of_shards` {ess-icon}::
  30. The number of primary shards that an index should have. Defaults to `1`. This setting can only be set at index creation time. It cannot be changed on a closed index.
  31. +
  32. NOTE: The number of shards are limited to `1024` per index. This limitation is a safety limit to prevent accidental creation of indices that can destabilize a cluster due to resource allocation. The limit can be modified by specifying `export ES_JAVA_OPTS="-Des.index.max_number_of_shards=128"` system property on every node that is part of the cluster.
  33. // end::index-number-of-shards-tag[]
  34. `index.shard.check_on_startup`::
  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.
  37. Accepts:
  38. `false`::: (default) Don't check for corruption when opening a shard.
  39. `checksum`::: Check for physical corruption.
  40. `true`::: Check for both physical and logical corruption. This is much more
  41. expensive in terms of CPU and memory usage.
  42. +
  43. WARNING: Expert only. Checking shards may take a lot of time on large
  44. indices.
  45. [[index-codec]] `index.codec`::
  46. The +default+ value compresses stored data with LZ4
  47. compression, but this can be set to +best_compression+
  48. which uses https://en.wikipedia.org/wiki/DEFLATE[DEFLATE] for a higher
  49. compression ratio, at the expense of slower stored fields performance.
  50. If you are updating the compression type, the new one will be applied
  51. after segments are merged. Segment merging can be forced using
  52. <<indices-forcemerge,force merge>>.
  53. [[routing-partition-size]] `index.routing_partition_size`::
  54. The number of shards a custom <<mapping-routing-field,routing>> value can go to.
  55. Defaults to 1 and can only be set at index creation time. This value must be less
  56. than the `index.number_of_shards` unless the `index.number_of_shards` value is also 1.
  57. See <<routing-index-partition>> for more details about how this setting is used.
  58. [[load-fixed-bitset-filters-eagerly]] `index.load_fixed_bitset_filters_eagerly`::
  59. Indicates whether <<query-filter-context, cached filters>> are pre-loaded for
  60. nested queries. Possible values are `true` (default) and `false`.
  61. [[index-hidden]] `index.hidden`::
  62. Indicates whether the index should be hidden by default. Hidden indices are not
  63. returned by default when using a wildcard expression. This behavior is controlled
  64. per request through the use of the `expand_wildcards` parameter. Possible values are
  65. `true` and `false` (default).
  66. [discrete]
  67. [[dynamic-index-settings]]
  68. === Dynamic index settings
  69. Below is a list of all _dynamic_ index settings that are not associated with any
  70. specific index module:
  71. [[dynamic-index-number-of-replicas]]
  72. `index.number_of_replicas`::
  73. The number of replicas each primary shard has. Defaults to 1.
  74. `index.auto_expand_replicas`::
  75. Auto-expand the number of replicas based on the number of data nodes in the cluster.
  76. Set to a dash delimited lower and upper bound (e.g. `0-5`) or use `all`
  77. for the upper bound (e.g. `0-all`). Defaults to `false` (i.e. disabled).
  78. Note that the auto-expanded number of replicas only takes
  79. <<shard-allocation-filtering,allocation filtering>> rules into account, but ignores
  80. any other allocation rules such as <<shard-allocation-awareness,shard allocation awareness>>
  81. and <<allocation-total-shards,total shards per node>>, and this can lead to the
  82. cluster health becoming `YELLOW` if the applicable rules prevent all the replicas
  83. from being allocated.
  84. `index.search.idle.after`::
  85. How long a shard can not receive a search or get request until it's considered
  86. search idle. (default is `30s`)
  87. [[index-refresh-interval-setting]]
  88. `index.refresh_interval`::
  89. How often to perform a refresh operation, which makes recent changes to the
  90. index visible to search. Defaults to `1s`. Can be set to `-1` to disable
  91. refresh. If this setting is not explicitly set, shards that haven't seen
  92. search traffic for at least `index.search.idle.after` seconds will not receive
  93. background refreshes until they receive a search request. Searches that hit an
  94. idle shard where a refresh is pending will wait for the next background
  95. refresh (within `1s`). This behavior aims to automatically optimize bulk
  96. indexing in the default case when no searches are performed. In order to opt
  97. out of this behavior an explicit value of `1s` should set as the refresh
  98. interval.
  99. [[index-max-result-window]]
  100. `index.max_result_window`::
  101. The maximum value of `from + size` for searches to this index. Defaults to
  102. `10000`. Search requests take heap memory and time proportional to
  103. `from + size` and this limits that memory. See
  104. <<request-body-search-scroll,Scroll>> or <<request-body-search-search-after,Search After>> for a more efficient alternative
  105. to raising this.
  106. `index.max_inner_result_window`::
  107. The maximum value of `from + size` for inner hits definition and top hits aggregations to this index. Defaults to
  108. `100`. Inner hits and top hits aggregation take heap memory and time proportional to `from + size` and this limits that memory.
  109. `index.max_rescore_window`::
  110. The maximum value of `window_size` for `rescore` requests in searches of this index.
  111. Defaults to `index.max_result_window` which defaults to `10000`. Search
  112. requests take heap memory and time proportional to
  113. `max(window_size, from + size)` and this limits that memory.
  114. `index.max_docvalue_fields_search`::
  115. The maximum number of `docvalue_fields` that are allowed in a query.
  116. Defaults to `100`. Doc-value fields are costly since they might incur
  117. a per-field per-document seek.
  118. `index.max_script_fields`::
  119. The maximum number of `script_fields` that are allowed in a query.
  120. Defaults to `32`.
  121. [[index-max-ngram-diff]]
  122. `index.max_ngram_diff`::
  123. The maximum allowed difference between min_gram and max_gram for NGramTokenizer and NGramTokenFilter.
  124. Defaults to `1`.
  125. [[index-max-shingle-diff]]
  126. `index.max_shingle_diff`::
  127. The maximum allowed difference between max_shingle_size and min_shingle_size
  128. for the <<analysis-shingle-tokenfilter,`shingle` token filter>>. Defaults to
  129. `3`.
  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. `index.max_terms_count`::
  142. The maximum number of terms that can be used in Terms Query.
  143. Defaults to `65536`.
  144. [[index-max-regex-length]]
  145. `index.max_regex_length`::
  146. The maximum length of regex that can be used in Regexp Query.
  147. Defaults to `1000`.
  148. `index.routing.allocation.enable`::
  149. Controls shard allocation for this index. It can be set to:
  150. * `all` (default) - Allows shard allocation for all shards.
  151. * `primaries` - Allows shard allocation only for primary shards.
  152. * `new_primaries` - Allows shard allocation only for newly-created primary shards.
  153. * `none` - No shard allocation is allowed.
  154. `index.routing.rebalance.enable`::
  155. Enables shard rebalancing for this index. It can be set to:
  156. * `all` (default) - Allows shard rebalancing for all shards.
  157. * `primaries` - Allows shard rebalancing only for primary shards.
  158. * `replicas` - Allows shard rebalancing only for replica shards.
  159. * `none` - No shard rebalancing is allowed.
  160. `index.gc_deletes`::
  161. The length of time that a <<delete-versioning,deleted document's version number>> remains available for <<index-versioning,further versioned operations>>.
  162. Defaults to `60s`.
  163. `index.default_pipeline`::
  164. The default <<ingest,ingest node>> pipeline for this index. Index requests will fail
  165. if the default pipeline is set and the pipeline does not exist. The default may be
  166. overridden using the `pipeline` parameter. The special pipeline name `_none` indicates
  167. no ingest pipeline should be run.
  168. `index.final_pipeline`::
  169. The final <<ingest,ingest node>> pipeline for this index. Index requests
  170. will fail if the final pipeline is set and the pipeline does not exist.
  171. The final pipeline always runs after the request pipeline (if specified) and
  172. the default pipeline (if it exists). The special pipeline name `_none`
  173. indicates no ingest pipeline will run.
  174. [discrete]
  175. === Settings in other index modules
  176. Other index settings are available in index modules:
  177. <<analysis,Analysis>>::
  178. Settings to define analyzers, tokenizers, token filters and character
  179. filters.
  180. <<index-modules-allocation,Index shard allocation>>::
  181. Control over where, when, and how shards are allocated to nodes.
  182. <<index-modules-mapper,Mapping>>::
  183. Enable or disable dynamic mapping for an index.
  184. <<index-modules-merge,Merging>>::
  185. Control over how shards are merged by the background merge process.
  186. <<index-modules-similarity,Similarities>>::
  187. Configure custom similarity settings to customize how search results are
  188. scored.
  189. <<index-modules-slowlog,Slowlog>>::
  190. Control over how slow queries and fetch requests are logged.
  191. <<index-modules-store,Store>>::
  192. Configure the type of filesystem used to access shard data.
  193. <<index-modules-translog,Translog>>::
  194. Control over the transaction log and background flush operations.
  195. <<index-modules-history-retention,History retention>>::
  196. Control over the retention of a history of operations in the index.
  197. <<index-modules-indexing-pressure,Indexing pressure>>::
  198. Configure indexing back pressure limits.
  199. [discrete]
  200. [[x-pack-index-settings]]
  201. === [xpack]#{xpack} index settings#
  202. <<ilm-settings,{ilm-cap}>>::
  203. Specify the lifecycle policy and rollover alias for an index.
  204. --
  205. include::index-modules/analysis.asciidoc[]
  206. include::index-modules/allocation.asciidoc[]
  207. include::index-modules/blocks.asciidoc[]
  208. include::index-modules/mapper.asciidoc[]
  209. include::index-modules/merge.asciidoc[]
  210. include::index-modules/similarity.asciidoc[]
  211. include::index-modules/slowlog.asciidoc[]
  212. include::index-modules/store.asciidoc[]
  213. include::index-modules/translog.asciidoc[]
  214. include::index-modules/history-retention.asciidoc[]
  215. include::index-modules/index-sorting.asciidoc[]
  216. include::index-modules/indexing-pressure.asciidoc[]