index-modules.asciidoc 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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. `fix`::
  45. Check for both physical and logical corruption. Segments that were reported
  46. as corrupted will be automatically removed. This option *may result in data loss*.
  47. Use with extreme caution!
  48. WARNING: Expert only. Checking shards may take a lot of time on large indices.
  49. --
  50. [[index-codec]] `index.codec`::
  51. The +default+ value compresses stored data with LZ4
  52. compression, but this can be set to +best_compression+
  53. which uses https://en.wikipedia.org/wiki/DEFLATE[DEFLATE] for a higher
  54. compression ratio, at the expense of slower stored fields performance.
  55. [[routing-partition-size]] `index.routing_partition_size`::
  56. The number of shards a custom <<mapping-routing-field,routing>> value can go to.
  57. Defaults to 1 and can only be set at index creation time. This value must be less
  58. than the `index.number_of_shards` unless the `index.number_of_shards` value is also 1.
  59. See <<routing-index-partition>> for more details about how this setting is used.
  60. [float]
  61. [[dynamic-index-settings]]
  62. === Dynamic index settings
  63. Below is a list of all _dynamic_ index settings that are not associated with any
  64. specific index module:
  65. `index.number_of_replicas`::
  66. The number of replicas each primary shard has. Defaults to 1.
  67. `index.auto_expand_replicas`::
  68. Auto-expand the number of replicas based on the number of available nodes.
  69. Set to a dash delimited lower and upper bound (e.g. `0-5`) or use `all`
  70. for the upper bound (e.g. `0-all`). Defaults to `false` (i.e. disabled).
  71. `index.refresh_interval`::
  72. How often to perform a refresh operation, which makes recent changes to the
  73. index visible to search. Defaults to `1s`. Can be set to `-1` to disable
  74. refresh.
  75. `index.max_result_window`::
  76. The maximum value of `from + size` for searches to this index. Defaults to
  77. `10000`. Search requests take heap memory and time proportional to
  78. `from + size` and this limits that memory. See
  79. <<search-request-scroll,Scroll>> or <<search-request-search-after,Search After>> for a more efficient alternative
  80. to raising this.
  81. `index.max_rescore_window`::
  82. The maximum value of `window_size` for `rescore` requests in searches of this index.
  83. Defaults to `index.max_result_window` which defaults to `10000`. Search
  84. requests take heap memory and time proportional to
  85. `max(window_size, from + size)` and this limits that memory.
  86. `index.blocks.read_only`::
  87. Set to `true` to make the index and index metadata read only, `false` to
  88. allow writes and metadata changes.
  89. `index.blocks.read_only_allow_delete`::
  90. Identical to `index.blocks.read_only` but allows deleting the index to free
  91. up resources.
  92. `index.blocks.read`::
  93. Set to `true` to disable read operations against the index.
  94. `index.blocks.write`::
  95. Set to `true` to disable write operations against the index.
  96. `index.blocks.metadata`::
  97. Set to `true` to disable index metadata reads and writes.
  98. `index.max_refresh_listeners`::
  99. Maximum number of refresh listeners available on each shard of the index.
  100. These listeners are used to implement <<docs-refresh,`refresh=wait_for`>>.
  101. [float]
  102. === Settings in other index modules
  103. Other index settings are available in index modules:
  104. <<analysis,Analysis>>::
  105. Settings to define analyzers, tokenizers, token filters and character
  106. filters.
  107. <<index-modules-allocation,Index shard allocation>>::
  108. Control over where, when, and how shards are allocated to nodes.
  109. <<index-modules-mapper,Mapping>>::
  110. Enable or disable dynamic mapping for an index.
  111. <<index-modules-merge,Merging>>::
  112. Control over how shards are merged by the background merge process.
  113. <<index-modules-similarity,Similarities>>::
  114. Configure custom similarity settings to customize how search results are
  115. scored.
  116. <<index-modules-slowlog,Slowlog>>::
  117. Control over how slow queries and fetch requests are logged.
  118. <<index-modules-store,Store>>::
  119. Configure the type of filesystem used to access shard data.
  120. <<index-modules-translog,Translog>>::
  121. Control over the transaction log and background flush operations.
  122. --
  123. include::index-modules/analysis.asciidoc[]
  124. include::index-modules/allocation.asciidoc[]
  125. include::index-modules/mapper.asciidoc[]
  126. include::index-modules/merge.asciidoc[]
  127. include::index-modules/similarity.asciidoc[]
  128. include::index-modules/slowlog.asciidoc[]
  129. include::index-modules/store.asciidoc[]
  130. include::index-modules/translog.asciidoc[]
  131. include::index-modules/index-sorting.asciidoc[]