index-modules.asciidoc 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
  1. [[index-modules]]
  2. = Index modules
  3. Index Modules are modules created per index and control all aspects related to
  4. an index.
  5. [discrete]
  6. [[index-modules-settings]]
  7. == Index Settings
  8. [[index-modules-settings-description]]
  9. // tag::index-modules-settings-description-tag[]
  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. // end::index-modules-settings-description-tag[]
  18. WARNING: Changing static or dynamic index settings on a closed index could
  19. result in incorrect settings that are impossible to rectify without deleting
  20. and recreating the index.
  21. [discrete]
  22. === Static index settings
  23. Below is a list of all _static_ index settings that are not associated with any
  24. specific index module:
  25. [[index-number-of-shards]]
  26. // tag::index-number-of-shards-tag[]
  27. `index.number_of_shards`::
  28. 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.
  29. +
  30. 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.
  31. // end::index-number-of-shards-tag[]
  32. [[index-number-of-routing-shards]]
  33. `index.number_of_routing_shards`::
  34. +
  35. ====
  36. Integer value used with <<index-number-of-shards,`index.number_of_shards`>> to
  37. route documents to a primary shard. See <<mapping-routing-field>>.
  38. {es} uses this value when <<indices-split-index,splitting>> 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-codec]] `index.codec`::
  56. The +default+ value compresses stored data with LZ4
  57. compression, but this can be set to +best_compression+
  58. which uses {wikipedia}/DEFLATE[DEFLATE] for a higher
  59. compression ratio, at the expense of slower stored fields performance.
  60. If you are updating the compression type, the new one will be applied
  61. after segments are merged. Segment merging can be forced using
  62. <<indices-forcemerge,force merge>>.
  63. [[routing-partition-size]] `index.routing_partition_size`::
  64. The number of shards a custom <<mapping-routing-field,routing>> value can go to.
  65. Defaults to 1 and can only be set at index creation time. This value must be less
  66. than the `index.number_of_shards` unless the `index.number_of_shards` value is also 1.
  67. See <<routing-index-partition>> for more details about how this setting is used.
  68. [[ccr-index-soft-deletes]]
  69. // tag::ccr-index-soft-deletes-tag[]
  70. `index.soft_deletes.enabled`::
  71. deprecated:[7.6.0, Creating indices with soft-deletes disabled is deprecated and will be removed in future Elasticsearch versions.]
  72. Indicates whether soft deletes are enabled on the index. Soft deletes can only
  73. be configured at index creation and only on indices created on or after
  74. {es} 6.5.0. Defaults to `true`.
  75. // end::ccr-index-soft-deletes-tag[]
  76. [[ccr-index-soft-deletes-retention-period]]
  77. //tag::ccr-index-soft-deletes-retention-tag[]
  78. `index.soft_deletes.retention_lease.period`::
  79. The maximum period to retain a shard history retention lease before it is
  80. considered expired. Shard history retention leases ensure that soft deletes are
  81. retained during merges on the Lucene index. If a soft delete is merged away
  82. before it can be replicated to a follower the following process will fail due
  83. to incomplete history on the leader. Defaults to `12h`.
  84. //end::ccr-index-soft-deletes-retention-tag[]
  85. [[load-fixed-bitset-filters-eagerly]] `index.load_fixed_bitset_filters_eagerly`::
  86. Indicates whether <<query-filter-context, cached filters>> are pre-loaded for
  87. nested queries. Possible values are `true` (default) and `false`.
  88. [[index-shard-check-on-startup]] `index.shard.check_on_startup`::
  89. +
  90. ====
  91. WARNING: Expert users only. This setting enables some very expensive processing
  92. at shard startup and is only ever useful while diagnosing a problem in your
  93. cluster. If you do use it, you should do so only temporarily and remove it
  94. once it is no longer needed.
  95. {es} automatically performs integrity checks on the contents of shards at
  96. various points during their lifecycle. For instance, it verifies the checksum
  97. of every file transferred when recovering a replica or taking a snapshot. It
  98. also verifies the integrity of many important files when opening a shard, which
  99. happens when starting up a node and when finishing a shard recovery or
  100. relocation. You can therefore manually verify the integrity of a whole shard
  101. while it is running by taking a snapshot of it into a fresh repository or by
  102. recovering it onto a fresh node.
  103. This setting determines whether {es} performs additional integrity checks while
  104. opening a shard. If these checks detect corruption then they will prevent the
  105. shard from being opened. It accepts the following values:
  106. `false`::: Don't perform additional checks for corruption when opening a shard.
  107. This is the default and recommended behaviour.
  108. `checksum`::: Verify that the checksum of every file in the shard matches its
  109. contents. This will detect cases where the data read from disk differ from the
  110. data that {es} originally wrote, for instance due to undetected disk corruption
  111. or other hardware failures. These checks require reading the entire shard from
  112. disk which takes substantial time and IO bandwidth and may affect cluster
  113. performance by evicting important data from your filesystem cache.
  114. `true`::: Performs the same checks as `checksum` and also checks for logical
  115. inconsistencies in the shard, which could for instance be caused by the data
  116. being corrupted while it was being written due to faulty RAM or other hardware
  117. failures. These checks require reading the entire shard from disk which takes
  118. substantial time and IO bandwidth, and then performing various checks on the
  119. contents of the shard which take substantial time, CPU and memory.
  120. ====
  121. [discrete]
  122. [[dynamic-index-settings]]
  123. === Dynamic index settings
  124. Below is a list of all _dynamic_ index settings that are not associated with any
  125. specific index module:
  126. [[dynamic-index-number-of-replicas]]
  127. `index.number_of_replicas`::
  128. The number of replicas each primary shard has. Defaults to 1.
  129. WARNING: Configuring it to 0 may lead to temporary availability loss
  130. during node restarts or permanent data loss in case of data corruption.
  131. [[dynamic-index-auto-expand-replicas]]
  132. `index.auto_expand_replicas`::
  133. Auto-expand the number of replicas based on the number of data nodes in the
  134. cluster. Set to a dash delimited lower and upper bound (e.g. `0-5`) or use `all`
  135. for the upper bound (e.g. `0-all`). Defaults to `false` (i.e. disabled). Note
  136. that the auto-expanded number of replicas only takes
  137. <<shard-allocation-filtering,allocation filtering>> rules into account, but
  138. ignores other allocation rules such as <<allocation-total-shards,total shards
  139. per node>>, and this can lead to the cluster health becoming `YELLOW` if the
  140. applicable rules prevent all the replicas from being allocated.
  141. +
  142. If the upper bound is `all` then <<shard-allocation-awareness,shard allocation
  143. awareness>> and
  144. <<cluster-routing-allocation-same-shard-host,`cluster.routing.allocation.same_shard.host`>>
  145. are ignored for this index.
  146. [[dynamic-index-search-idle-after]]
  147. `index.search.idle.after`::
  148. How long a shard can not receive a search or get request until it's considered
  149. search idle. (default is `30s`)
  150. [[index-refresh-interval-setting]]
  151. `index.refresh_interval`::
  152. How often to perform a refresh operation, which makes recent changes to the
  153. index visible to search. Defaults to `1s`. Can be set to `-1` to disable
  154. refresh. If this setting is not explicitly set, shards that haven't seen
  155. search traffic for at least `index.search.idle.after` seconds will not receive
  156. background refreshes until they receive a search request. Searches that hit an
  157. idle shard where a refresh is pending will wait for the next background
  158. refresh (within `1s`). This behavior aims to automatically optimize bulk
  159. indexing in the default case when no searches are performed. In order to opt
  160. out of this behavior an explicit value of `1s` should set as the refresh
  161. interval.
  162. [[index-max-result-window]]
  163. `index.max_result_window`::
  164. The maximum value of `from + size` for searches to this index. Defaults to
  165. `10000`. Search requests take heap memory and time proportional to
  166. `from + size` and this limits that memory. See
  167. <<scroll-search-results,Scroll>> or <<search-after,Search After>> for a more efficient alternative
  168. to raising this.
  169. `index.max_inner_result_window`::
  170. The maximum value of `from + size` for inner hits definition and top hits aggregations to this index. Defaults to
  171. `100`. Inner hits and top hits aggregation take heap memory and time proportional to `from + size` and this limits that memory.
  172. `index.max_rescore_window`::
  173. The maximum value of `window_size` for `rescore` requests in searches of this index.
  174. Defaults to `index.max_result_window` which defaults to `10000`. Search
  175. requests take heap memory and time proportional to
  176. `max(window_size, from + size)` and this limits that memory.
  177. `index.max_docvalue_fields_search`::
  178. The maximum number of `docvalue_fields` that are allowed in a query.
  179. Defaults to `100`. Doc-value fields are costly since they might incur
  180. a per-field per-document seek.
  181. `index.max_script_fields`::
  182. The maximum number of `script_fields` that are allowed in a query.
  183. Defaults to `32`.
  184. [[index-max-ngram-diff]]
  185. `index.max_ngram_diff`::
  186. The maximum allowed difference between min_gram and max_gram for NGramTokenizer and NGramTokenFilter.
  187. Defaults to `1`.
  188. [[index-max-shingle-diff]]
  189. `index.max_shingle_diff`::
  190. The maximum allowed difference between max_shingle_size and min_shingle_size
  191. for the <<analysis-shingle-tokenfilter,`shingle` token filter>>. Defaults to
  192. `3`.
  193. `index.max_refresh_listeners`::
  194. Maximum number of refresh listeners available on each shard of the index.
  195. These listeners are used to implement <<docs-refresh,`refresh=wait_for`>>.
  196. `index.analyze.max_token_count`::
  197. The maximum number of tokens that can be produced using _analyze API.
  198. Defaults to `10000`.
  199. [[index-max-analyzed-offset]]
  200. `index.highlight.max_analyzed_offset`::
  201. The maximum number of characters that will be analyzed for a highlight request.
  202. This setting is only applicable when highlighting is requested on a text that was indexed without offsets or term vectors.
  203. Defaults to `1000000`.
  204. [[index-max-terms-count]]
  205. `index.max_terms_count`::
  206. The maximum number of terms that can be used in Terms Query.
  207. Defaults to `65536`.
  208. [[index-max-regex-length]]
  209. `index.max_regex_length`::
  210. The maximum length of regex that can be used in Regexp Query.
  211. Defaults to `1000`.
  212. [[index-query-default-field]]
  213. `index.query.default_field`::
  214. +
  215. --
  216. (string or array of strings)
  217. Wildcard (`*`) patterns matching one or more fields. The following query types
  218. search these matching fields by default:
  219. * <<query-dsl-mlt-query>>
  220. * <<query-dsl-multi-match-query>>
  221. * <<query-dsl-query-string-query>>
  222. * <<query-dsl-simple-query-string-query>>
  223. Defaults to `*`, which matches all fields eligible for
  224. <<term-level-queries,term-level queries>>, excluding metadata fields.
  225. --
  226. [[index-routing-allocation-enable-setting]]
  227. `index.routing.allocation.enable`::
  228. Controls shard allocation for this index. It can be set to:
  229. * `all` (default) - Allows shard allocation for all shards.
  230. * `primaries` - Allows shard allocation only for primary shards.
  231. * `new_primaries` - Allows shard allocation only for newly-created primary shards.
  232. * `none` - No shard allocation is allowed.
  233. `index.routing.rebalance.enable`::
  234. Enables shard rebalancing for this index. It can be set to:
  235. * `all` (default) - Allows shard rebalancing for all shards.
  236. * `primaries` - Allows shard rebalancing only for primary shards.
  237. * `replicas` - Allows shard rebalancing only for replica shards.
  238. * `none` - No shard rebalancing is allowed.
  239. `index.gc_deletes`::
  240. The length of time that a <<delete-versioning,deleted document's version number>> remains available for <<index-versioning,further versioned operations>>.
  241. Defaults to `60s`.
  242. [[index-default-pipeline]]
  243. `index.default_pipeline`::
  244. Default <<ingest,ingest pipeline>> for the index. Index requests will fail
  245. if the default pipeline is set and the pipeline does not exist. The default may be
  246. overridden using the `pipeline` parameter. The special pipeline name `_none` indicates
  247. no default ingest pipeline will run.
  248. [[index-final-pipeline]]
  249. `index.final_pipeline`::
  250. Final <<ingest,ingest pipeline>> for the index. Indexing requests
  251. will fail if the final pipeline is set and the pipeline does not exist.
  252. The final pipeline always runs after the request pipeline (if specified) and
  253. the default pipeline (if it exists). The special pipeline name `_none`
  254. indicates no final ingest pipeline will run.
  255. +
  256. NOTE: You can't use a final pipeline to change the `_index` field. If the
  257. pipeline attempts to change the `_index` field, the indexing request will fail.
  258. [[index-hidden]] `index.hidden`::
  259. Indicates whether the index should be hidden by default. Hidden indices are not
  260. returned by default when using a wildcard expression. This behavior is controlled
  261. per request through the use of the `expand_wildcards` parameter. Possible values are
  262. `true` and `false` (default).
  263. [discrete]
  264. === Settings in other index modules
  265. Other index settings are available in index modules:
  266. <<analysis,Analysis>>::
  267. Settings to define analyzers, tokenizers, token filters and character
  268. filters.
  269. <<index-modules-allocation,Index shard allocation>>::
  270. Control over where, when, and how shards are allocated to nodes.
  271. <<index-modules-mapper,Mapping>>::
  272. Enable or disable dynamic mapping for an index.
  273. <<index-modules-merge,Merging>>::
  274. Control over how shards are merged by the background merge process.
  275. <<index-modules-similarity,Similarities>>::
  276. Configure custom similarity settings to customize how search results are
  277. scored.
  278. <<index-modules-slowlog,Slowlog>>::
  279. Control over how slow queries and fetch requests are logged.
  280. <<index-modules-store,Store>>::
  281. Configure the type of filesystem used to access shard data.
  282. <<index-modules-translog,Translog>>::
  283. Control over the transaction log and background flush operations.
  284. <<index-modules-history-retention,History retention>>::
  285. Control over the retention of a history of operations in the index.
  286. <<index-modules-indexing-pressure,Indexing pressure>>::
  287. Configure indexing back pressure limits.
  288. [discrete]
  289. [[x-pack-index-settings]]
  290. === [xpack]#{xpack} index settings#
  291. <<ilm-settings,{ilm-cap}>>::
  292. Specify the lifecycle policy and rollover alias for an index.
  293. include::index-modules/analysis.asciidoc[]
  294. include::index-modules/allocation.asciidoc[]
  295. include::index-modules/blocks.asciidoc[]
  296. include::index-modules/mapper.asciidoc[]
  297. include::index-modules/merge.asciidoc[]
  298. include::index-modules/similarity.asciidoc[]
  299. include::index-modules/slowlog.asciidoc[]
  300. include::index-modules/store.asciidoc[]
  301. include::index-modules/translog.asciidoc[]
  302. include::index-modules/history-retention.asciidoc[]
  303. include::index-modules/index-sorting.asciidoc[]
  304. include::index-modules/indexing-pressure.asciidoc[]