OpenSearch/docs/reference/indices.asciidoc

192 lines
4.2 KiB
Plaintext
Raw Normal View History

[[indices]]
== Index APIs
Index APIs are used to manage individual indices,
index settings, aliases, mappings, and index templates.
[discrete]
[[index-management]]
=== Index management:
* <<indices-create-index>>
* <<indices-delete-index>>
* <<indices-get-index>>
* <<indices-exists>>
* <<indices-close>>
* <<indices-open-close>>
Add primitive to shrink an index into a single shard (#18270) This adds a low level primitive operations to shrink an existing index into a new index with a single shard. This primitive expects all shards of the source index to allocated on a single node. Once the target index is initializing on the shrink node it takes a snapshot of the source index shards and copies all files into the target indices data folder. An [optimization](https://issues.apache.org/jira/browse/LUCENE-7300) coming in Lucene 6.1 will also allow for optional constant time copy if hard-links are supported by the filesystem. All mappings are merged into the new indexes metadata once the snapshots have been taken on the merge node. To shrink an existing index all shards must be moved to a single node (one instance of each shard) and the index must be read-only: ```BASH $ curl -XPUT 'http://localhost:9200/logs/_settings' -d '{ "settings" : { "index.routing.allocation.require._name" : "shrink_node_name", "index.blocks.write" : true } } ``` once all shards are started on the shrink node. the new index can be created via: ```BASH $ curl -XPUT 'http://localhost:9200/logs/_shrink/logs_single_shard' -d '{ "settings" : { "index.codec" : "best_compression", "index.number_of_replicas" : 1 } }' ``` This API will perform all needed check before the new index is created and selects the shrink node based on the allocation of the source index. This call returns immediately, to monitor shrink progress the recovery API should be used since all copy operations are reflected in the recovery API with byte copy progress etc. The shrink operation does not modify the source index, if a shrink operation should be canceled or if the shrink failed, the target index can simply be deleted and all resources are released.
2016-05-31 04:41:44 -04:00
* <<indices-shrink-index>>
Add ability to split shards (#26931) This change adds a new `_split` API that allows to split indices into a new index with a power of two more shards that the source index. This API works alongside the `_shrink` API but doesn't require any shard relocation before indices can be split. The split operation is conceptually an inverse `_shrink` operation since we initialize the index with a _syntetic_ number of routing shards that are used for the consistent hashing at index time. Compared to indices created with earlier versions this might produce slightly different shard distributions but has no impact on the per-index backwards compatibility. For now, the user is required to prepare an index to be splittable by setting the `index.number_of_routing_shards` at index creation time. The setting allows the user to prepare the index to be splittable in factors of `index.number_of_routing_shards` ie. if the index is created with `index.number_of_routing_shards: 16` and `index.number_of_shards: 2` it can be split into `4, 8, 16` shards. This is an intermediate step until we can make this the default. This also allows us to safely backport this change to 6.x. The `_split` operation is implemented internally as a DeleteByQuery on the lucene level that is executed while the primary shards execute their initial recovery. Subsequent merges that are triggered due to this operation will not be executed immediately. All merges will be deferred unti the shards are started and will then be throttled accordingly. This change is intended for the 6.1 feature release but will not support pre-6.1 indices to be split unless these indices have been shrunk before. In that case these indices can be split backwards into their original number of shards.
2017-11-06 05:37:55 -05:00
* <<indices-split-index>>
* <<indices-clone-index>>
2016-06-08 18:32:22 -04:00
* <<indices-rollover-index>>
* <<freeze-index-api>>
* <<unfreeze-index-api>>
* <<indices-resolve-index-api>>
[discrete]
[[mapping-management]]
=== Mapping management:
* <<indices-put-mapping>>
* <<indices-get-mapping>>
* <<indices-get-field-mapping>>
* <<indices-types-exists>>
[discrete]
[[alias-management]]
=== Alias management:
* <<indices-add-alias>>
* <<indices-delete-alias>>
* <<indices-get-alias>>
* <<indices-alias-exists>>
* <<indices-aliases>>
[discrete]
[[index-settings]]
=== Index settings:
* <<indices-update-settings>>
* <<indices-get-settings>>
* <<indices-analyze>>
[discrete]
[[index-templates-apis]]
=== Index templates:
Index templates automatically apply settings, mappings, and aliases to new indices.
They are most often used to configure rolling indices for time series data to
ensure that each new index has the same configuration as the previous one.
The index template associated with a data stream configures its backing indices.
For more information, see <<indices-templates, Index Templates>>.
* <<indices-put-template>>
* <<indices-get-template>>
* <<indices-delete-template>>
* <<indices-component-template>>
* <<getting-component-templates>>
* <<indices-delete-component-template>>
* <<indices-template-exists>>
* <<indices-simulate-index>>
* <<indices-simulate-template>>
[discrete]
[[monitoring]]
=== Monitoring:
* <<indices-stats>>
* <<indices-segments>>
* <<indices-recovery>>
* <<indices-shards-stores>>
[discrete]
[[status-management]]
=== Status management:
* <<indices-clearcache>>
* <<indices-refresh>>
* <<indices-flush>>
* <<indices-synced-flush-api>>
* <<indices-forcemerge>>
[discrete]
[[dangling-indices-api]]
=== Dangling indices:
* <<dangling-indices-list>>
* <<dangling-index-import>>
* <<dangling-index-delete>>
include::indices/add-alias.asciidoc[]
include::indices/analyze.asciidoc[]
include::indices/clearcache.asciidoc[]
include::indices/clone-index.asciidoc[]
include::indices/close.asciidoc[]
2016-05-31 05:50:50 -04:00
include::indices/create-index.asciidoc[]
include::indices/delete-index.asciidoc[]
include::indices/delete-alias.asciidoc[]
2016-06-17 12:14:45 -04:00
include::indices/delete-component-template.asciidoc[]
include::indices/delete-index-template.asciidoc[]
include::indices/flush.asciidoc[]
include::indices/forcemerge.asciidoc[]
include::indices/apis/freeze.asciidoc[]
include::indices/get-component-template.asciidoc[]
include::indices/get-field-mapping.asciidoc[]
include::indices/get-index.asciidoc[]
include::indices/get-alias.asciidoc[]
include::indices/get-settings.asciidoc[]
include::indices/get-index-template.asciidoc[]
include::indices/get-index-template-v1.asciidoc[]
include::indices/get-mapping.asciidoc[]
include::indices/alias-exists.asciidoc[]
include::indices/indices-exists.asciidoc[]
include::indices/recovery.asciidoc[]
include::indices/segments.asciidoc[]
include::indices/shard-stores.asciidoc[]
include::indices/stats.asciidoc[]
include::indices/template-exists.asciidoc[]
include::indices/open-close.asciidoc[]
include::indices/put-index-template.asciidoc[]
include::indices/put-index-template-v1.asciidoc[]
include::indices/put-component-template.asciidoc[]
include::indices/put-mapping.asciidoc[]
include::indices/refresh.asciidoc[]
include::indices/rollover-index.asciidoc[]
include::indices/shrink-index.asciidoc[]
include::indices/simulate-index.asciidoc[]
include::indices/simulate-template.asciidoc[]
include::indices/split-index.asciidoc[]
include::indices/synced-flush.asciidoc[]
include::indices/types-exists.asciidoc[]
include::indices/apis/unfreeze.asciidoc[]
include::indices/aliases.asciidoc[]
2020-05-15 10:37:45 -04:00
include::indices/update-settings.asciidoc[]
include::indices/resolve.asciidoc[]
include::indices/dangling-indices-list.asciidoc[]
include::indices/dangling-index-import.asciidoc[]
include::indices/dangling-index-delete.asciidoc[]