OpenSearch/docs/reference
Simon Willnauer 502a775a7c 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 10:41:44 +02:00
..
aggregations Add back support for `ip` range aggregations. #17859 2016-05-13 17:22:01 +02:00
analysis Docs: Improved tokenizer docs (#18356) 2016-05-19 19:42:23 +02:00
cat Merge branch 'pr/18068' 2016-05-10 08:27:43 -06:00
cluster Merge remote-tracking branch 'dakrone/explain-add-fetch-in-progress' 2016-05-23 09:43:16 -06:00
docs Remove Delete-By-Query plugin 2016-05-24 13:28:20 +02:00
images Updated decay-function image in function_score query 2016-04-20 13:37:52 +02:00
index-modules Docs: Replace [source,json] with [source,js] 2016-05-24 11:17:27 -04:00
indices Add primitive to shrink an index into a single shard (#18270) 2016-05-31 10:41:44 +02:00
ingest add ability to specify multiple grok patterns (#18074) 2016-05-25 12:20:39 -07:00
mapping Make doc_values accessible for _type 2016-05-25 18:56:13 +02:00
migration Nested inner hits shouldn't use relative paths 2016-05-27 13:41:45 +02:00
modules Merge pull request #18594 from jasontedor/plugins-cleanup 2016-05-26 14:46:09 -04:00
query-dsl Add wait for yellow to doc snippet so it runs cleanly 2016-05-24 12:15:52 -04:00
release-notes Added release notes for 5.0.0-alpha2 2016-05-02 14:21:59 +02:00
search Merge pull request #18424 from MaineC/docs/add_console_to_highlighting 2016-05-24 12:14:36 +02:00
setup Fix min. master nodes links in boostrap check docs 2016-05-29 08:01:16 -04:00
testing Introduce dedicated master nodes in testing infrastructure (#18514) 2016-05-27 08:44:20 +02:00
aggregations.asciidoc Merge pull request #16741 from blachniet/patch-1 2016-03-02 10:57:56 +01:00
analysis.asciidoc First pass at improving analyzer docs (#18269) 2016-05-11 14:17:56 +02:00
api-conventions.asciidoc Lessen leniency of the query dsl. #18276 2016-05-16 17:37:00 +02:00
cat.asciidoc Add support for documented byte/size units and for micros as a time unit in _cat API 2016-04-15 20:55:41 +02:00
cluster.asciidoc Update task management docs to reflect the latest changes in the interface 2016-03-29 12:26:37 -04:00
docs.asciidoc Port Delete By Query to Reindex infrastructure 2016-05-19 16:07:50 +02:00
getting-started.asciidoc Remove settings and system properties entanglement 2016-05-19 14:08:08 -04:00
glossary.asciidoc Improve glossary to not refer to types as "like a table" (#17704) 2016-04-13 14:29:47 +02:00
index-modules.asciidoc Fix fallback setting for two get/2 2016-04-22 11:10:01 -04:00
index.asciidoc Bumped docs version 2016-05-03 15:35:33 +02:00
indices.asciidoc Add primitive to shrink an index into a single shard (#18270) 2016-05-31 10:41:44 +02:00
ingest.asciidoc Renamed all AUTOSENSE snippets to CONSOLE (#18210) 2016-05-09 15:42:23 +02:00
mapping.asciidoc Renamed all AUTOSENSE snippets to CONSOLE (#18210) 2016-05-09 15:42:23 +02:00
modules.asciidoc Reorganise scripting docs (#18132) 2016-05-04 18:17:10 +02:00
query-dsl.asciidoc Fixed broken xrefs to query-dsl-not-query, which has been removed. 2015-10-20 13:01:37 -07:00
redirects.asciidoc Docs: Complete rewrite of setup, installation, and configuration docs 2016-04-03 16:09:48 +02:00
release-notes.asciidoc Added release notes for 5.0.0-alpha2 2016-05-02 14:21:59 +02:00
search.asciidoc Add documentation for global search timeout 2016-01-07 10:42:18 -05:00
setup.asciidoc Add bootstrap check docs 2016-05-27 06:03:35 -04:00
testing.asciidoc [DOCS] Test framework documentation 2013-12-02 18:01:45 +01:00