index-modules.asciidoc 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  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-number-of-routing-shards]]
  35. `index.number_of_routing_shards`::
  36. +
  37. ====
  38. Number of routing shards used to <<indices-split-index,split>> an index.
  39. For example, a 5 shard index with `number_of_routing_shards` set to `30` (`5 x
  40. 2 x 3`) could be split by a factor of `2` or `3`. In other words, it could be
  41. split as follows:
  42. * `5` -> `10` -> `30` (split by 2, then by 3)
  43. * `5` -> `15` -> `30` (split by 3, then by 2)
  44. * `5` -> `30` (split by 6)
  45. This setting's default value depends on the number of primary shards in the
  46. index. The default is designed to allow you to split by factors of 2 up
  47. to a maximum of 1024 shards.
  48. NOTE: In {es} 7.0.0 and later versions, this setting affects how documents are
  49. distributed across shards. When reindexing an older index with custom routing,
  50. you must explicitly set `index.number_of_routing_shards` to maintain the same
  51. document distribution. See the
  52. {ref-70}/breaking-changes-7.0.html#_document_distribution_changes[related
  53. breaking change].
  54. ====
  55. `index.shard.check_on_startup`::
  56. Whether or not shards should be checked for corruption before opening. When
  57. corruption is detected, it will prevent the shard from being opened.
  58. Accepts:
  59. `false`::: (default) Don't check for corruption when opening a shard.
  60. `checksum`::: Check for physical corruption.
  61. `true`::: Check for both physical and logical corruption. This is much more
  62. expensive in terms of CPU and memory usage.
  63. +
  64. WARNING: Expert only. Checking shards may take a lot of time on large
  65. indices.
  66. [[index-codec]] `index.codec`::
  67. The +default+ value compresses stored data with LZ4
  68. compression, but this can be set to +best_compression+
  69. which uses {wikipedia}/DEFLATE[DEFLATE] for a higher
  70. compression ratio, at the expense of slower stored fields performance.
  71. If you are updating the compression type, the new one will be applied
  72. after segments are merged. Segment merging can be forced using
  73. <<indices-forcemerge,force merge>>.
  74. [[routing-partition-size]] `index.routing_partition_size`::
  75. The number of shards a custom <<mapping-routing-field,routing>> value can go to.
  76. Defaults to 1 and can only be set at index creation time. This value must be less
  77. than the `index.number_of_shards` unless the `index.number_of_shards` value is also 1.
  78. See <<routing-index-partition>> for more details about how this setting is used.
  79. [[ccr-index-soft-deletes]]
  80. // tag::ccr-index-soft-deletes-tag[]
  81. `index.soft_deletes.enabled`::
  82. deprecated:[7.6.0, Creating indices with soft-deletes disabled is deprecated and will be removed in future Elasticsearch versions.]
  83. Indicates whether soft deletes are enabled on the index. Soft deletes can only
  84. be configured at index creation and only on indices created on or after
  85. {es} 6.5.0. Defaults to `true`.
  86. // end::ccr-index-soft-deletes-tag[]
  87. [[ccr-index-soft-deletes-retention-period]]
  88. //tag::ccr-index-soft-deletes-retention-tag[]
  89. `index.soft_deletes.retention_lease.period`::
  90. The maximum period to retain a shard history retention lease before it is
  91. considered expired. Shard history retention leases ensure that soft deletes are
  92. retained during merges on the Lucene index. If a soft delete is merged away
  93. before it can be replicated to a follower the following process will fail due
  94. to incomplete history on the leader. Defaults to `12h`.
  95. //end::ccr-index-soft-deletes-retention-tag[]
  96. [[load-fixed-bitset-filters-eagerly]] `index.load_fixed_bitset_filters_eagerly`::
  97. Indicates whether <<query-filter-context, cached filters>> are pre-loaded for
  98. nested queries. Possible values are `true` (default) and `false`.
  99. [[index-hidden]] `index.hidden`::
  100. Indicates whether the index should be hidden by default. Hidden indices are not
  101. returned by default when using a wildcard expression. This behavior is controlled
  102. per request through the use of the `expand_wildcards` parameter. Possible values are
  103. `true` and `false` (default).
  104. [discrete]
  105. [[dynamic-index-settings]]
  106. === Dynamic index settings
  107. Below is a list of all _dynamic_ index settings that are not associated with any
  108. specific index module:
  109. [[dynamic-index-number-of-replicas]]
  110. `index.number_of_replicas`::
  111. The number of replicas each primary shard has. Defaults to 1.
  112. `index.auto_expand_replicas`::
  113. Auto-expand the number of replicas based on the number of data nodes in the
  114. cluster. Set to a dash delimited lower and upper bound (e.g. `0-5`) or use `all`
  115. for the upper bound (e.g. `0-all`). Defaults to `false` (i.e. disabled). Note
  116. that the auto-expanded number of replicas only takes
  117. <<shard-allocation-filtering,allocation filtering>> rules into account, but
  118. ignores other allocation rules such as <<allocation-total-shards,total shards
  119. per node>>, and this can lead to the cluster health becoming `YELLOW` if the
  120. applicable rules prevent all the replicas from being allocated.
  121. +
  122. If the upper bound is `all` then <<shard-allocation-awareness,shard allocation
  123. awareness>> and
  124. <<cluster-routing-allocation-same-shard-host,`cluster.routing.allocation.same_shard.host`>>
  125. are ignored for this index.
  126. `index.search.idle.after`::
  127. How long a shard can not receive a search or get request until it's considered
  128. search idle. (default is `30s`)
  129. [[index-refresh-interval-setting]]
  130. `index.refresh_interval`::
  131. How often to perform a refresh operation, which makes recent changes to the
  132. index visible to search. Defaults to `1s`. Can be set to `-1` to disable
  133. refresh. If this setting is not explicitly set, shards that haven't seen
  134. search traffic for at least `index.search.idle.after` seconds will not receive
  135. background refreshes until they receive a search request. Searches that hit an
  136. idle shard where a refresh is pending will wait for the next background
  137. refresh (within `1s`). This behavior aims to automatically optimize bulk
  138. indexing in the default case when no searches are performed. In order to opt
  139. out of this behavior an explicit value of `1s` should set as the refresh
  140. interval.
  141. [[index-max-result-window]]
  142. `index.max_result_window`::
  143. The maximum value of `from + size` for searches to this index. Defaults to
  144. `10000`. Search requests take heap memory and time proportional to
  145. `from + size` and this limits that memory. See
  146. <<scroll-search-results,Scroll>> or <<search-after,Search After>> for a more efficient alternative
  147. to raising this.
  148. `index.max_inner_result_window`::
  149. The maximum value of `from + size` for inner hits definition and top hits aggregations to this index. Defaults to
  150. `100`. Inner hits and top hits aggregation take heap memory and time proportional to `from + size` and this limits that memory.
  151. `index.max_rescore_window`::
  152. The maximum value of `window_size` for `rescore` requests in searches of this index.
  153. Defaults to `index.max_result_window` which defaults to `10000`. Search
  154. requests take heap memory and time proportional to
  155. `max(window_size, from + size)` and this limits that memory.
  156. `index.max_docvalue_fields_search`::
  157. The maximum number of `docvalue_fields` that are allowed in a query.
  158. Defaults to `100`. Doc-value fields are costly since they might incur
  159. a per-field per-document seek.
  160. `index.max_script_fields`::
  161. The maximum number of `script_fields` that are allowed in a query.
  162. Defaults to `32`.
  163. [[index-max-ngram-diff]]
  164. `index.max_ngram_diff`::
  165. The maximum allowed difference between min_gram and max_gram for NGramTokenizer and NGramTokenFilter.
  166. Defaults to `1`.
  167. [[index-max-shingle-diff]]
  168. `index.max_shingle_diff`::
  169. The maximum allowed difference between max_shingle_size and min_shingle_size
  170. for the <<analysis-shingle-tokenfilter,`shingle` token filter>>. Defaults to
  171. `3`.
  172. `index.max_refresh_listeners`::
  173. Maximum number of refresh listeners available on each shard of the index.
  174. These listeners are used to implement <<docs-refresh,`refresh=wait_for`>>.
  175. `index.analyze.max_token_count`::
  176. The maximum number of tokens that can be produced using _analyze API.
  177. Defaults to `10000`.
  178. [[index-max-analyzed-offset]]
  179. `index.highlight.max_analyzed_offset`::
  180. The maximum number of characters that will be analyzed for a highlight request.
  181. This setting is only applicable when highlighting is requested on a text that was indexed without offsets or term vectors.
  182. Defaults to `1000000`.
  183. [[index-max-terms-count]]
  184. `index.max_terms_count`::
  185. The maximum number of terms that can be used in Terms Query.
  186. Defaults to `65536`.
  187. [[index-max-regex-length]]
  188. `index.max_regex_length`::
  189. The maximum length of regex that can be used in Regexp Query.
  190. Defaults to `1000`.
  191. `index.routing.allocation.enable`::
  192. Controls shard allocation for this index. It can be set to:
  193. * `all` (default) - Allows shard allocation for all shards.
  194. * `primaries` - Allows shard allocation only for primary shards.
  195. * `new_primaries` - Allows shard allocation only for newly-created primary shards.
  196. * `none` - No shard allocation is allowed.
  197. `index.routing.rebalance.enable`::
  198. Enables shard rebalancing for this index. It can be set to:
  199. * `all` (default) - Allows shard rebalancing for all shards.
  200. * `primaries` - Allows shard rebalancing only for primary shards.
  201. * `replicas` - Allows shard rebalancing only for replica shards.
  202. * `none` - No shard rebalancing is allowed.
  203. `index.gc_deletes`::
  204. The length of time that a <<delete-versioning,deleted document's version number>> remains available for <<index-versioning,further versioned operations>>.
  205. Defaults to `60s`.
  206. [[index-default-pipeline]]
  207. `index.default_pipeline`::
  208. The default <<ingest,ingest node>> pipeline for this index. Index requests will fail
  209. if the default pipeline is set and the pipeline does not exist. The default may be
  210. overridden using the `pipeline` parameter. The special pipeline name `_none` indicates
  211. no ingest pipeline should be run.
  212. [[index-final-pipeline]]
  213. `index.final_pipeline`::
  214. The final <<ingest,ingest node>> pipeline for this index. Index requests
  215. will fail if the final pipeline is set and the pipeline does not exist.
  216. The final pipeline always runs after the request pipeline (if specified) and
  217. the default pipeline (if it exists). The special pipeline name `_none`
  218. indicates no ingest pipeline will run.
  219. [discrete]
  220. === Settings in other index modules
  221. Other index settings are available in index modules:
  222. <<analysis,Analysis>>::
  223. Settings to define analyzers, tokenizers, token filters and character
  224. filters.
  225. <<index-modules-allocation,Index shard allocation>>::
  226. Control over where, when, and how shards are allocated to nodes.
  227. <<index-modules-mapper,Mapping>>::
  228. Enable or disable dynamic mapping for an index.
  229. <<index-modules-merge,Merging>>::
  230. Control over how shards are merged by the background merge process.
  231. <<index-modules-similarity,Similarities>>::
  232. Configure custom similarity settings to customize how search results are
  233. scored.
  234. <<index-modules-slowlog,Slowlog>>::
  235. Control over how slow queries and fetch requests are logged.
  236. <<index-modules-store,Store>>::
  237. Configure the type of filesystem used to access shard data.
  238. <<index-modules-translog,Translog>>::
  239. Control over the transaction log and background flush operations.
  240. <<index-modules-history-retention,History retention>>::
  241. Control over the retention of a history of operations in the index.
  242. <<index-modules-indexing-pressure,Indexing pressure>>::
  243. Configure indexing back pressure limits.
  244. [discrete]
  245. [[x-pack-index-settings]]
  246. === [xpack]#{xpack} index settings#
  247. <<ilm-settings,{ilm-cap}>>::
  248. Specify the lifecycle policy and rollover alias for an index.
  249. --
  250. include::index-modules/analysis.asciidoc[]
  251. include::index-modules/allocation.asciidoc[]
  252. include::index-modules/blocks.asciidoc[]
  253. include::index-modules/mapper.asciidoc[]
  254. include::index-modules/merge.asciidoc[]
  255. include::index-modules/similarity.asciidoc[]
  256. include::index-modules/slowlog.asciidoc[]
  257. include::index-modules/store.asciidoc[]
  258. include::index-modules/translog.asciidoc[]
  259. include::index-modules/history-retention.asciidoc[]
  260. include::index-modules/index-sorting.asciidoc[]
  261. include::index-modules/indexing-pressure.asciidoc[]