Skip to content

Commit 0ec053f

Browse files
Improve docs for split API in 6.1/6.x (#27504)
1 parent 00c9d7d commit 0ec053f

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

docs/reference/indices/split-index.asciidoc

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
[[indices-split-index]]
22
== Split Index
33

4-
number_of_routing_shards
5-
6-
The split index API allows you to split an existing index into a new index
7-
with multiple of it's primary shards. Similarly to the <<indices-shrink-index,Shrink API>>
8-
where the number of primary shards in the shrunk index must be a factor of the source index.
9-
The `_split` API requires the source index to be created with a specific number of routing shards
10-
in order to be split in the future. (Note: this requirement might be remove in future releases)
11-
The number of routing shards specify the hashing space that is used internally to distribute documents
12-
across shards, in oder to have a consistent hashing that is compatible with the method elasticsearch
13-
uses today.
14-
For example an index with `8` primary shards and a `index.number_of_routing_shards` of `32`
15-
can be split into `16` and `32` primary shards. An index with `1` primary shard
16-
and `index.number_of_routing_shards` of `64` can be split into `2`, `4`, `8`, `16`, `32` or `64`.
17-
The same works for non power of two routing shards ie. an index with `1` primary shard and
18-
`index.number_of_routing_shards` set to `15` can be split into `3` and `15` or alternatively`5` and `15`.
19-
The number of shards in the split index must always be a factor of `index.number_of_routing_shards`
20-
in the source index. Before splitting, a (primary) copy of every shard in the index must be active in the cluster.
4+
The split index API allows you to split an existing index into a new index,
5+
where each original primary shard is split into two or more primary shards in
6+
the new index.
7+
8+
IMPORTANT: The `_split` API requires the source index to be created with a
9+
specific `number_of_routing_shards` in order to be split in the future. This
10+
requirement has been removed in Elasticsearch 7.0.
11+
12+
The number of times the index can be split (and the number of shards that each
13+
original shard can be split into) is determined by the
14+
`index.number_of_routing_shards` setting. The number of routing shards
15+
specifies the hashing space that is used internally to distribute documents
16+
across shards with consistent hashing. For instance, a 5 shard index with
17+
`number_of_routing_shards` set to `30` (`5 x 2 x 3`) could be split by a
18+
factor of `2` or `3`. In other words, it could be split as follows:
19+
20+
* `5` -> `10` -> `30` (split by 2, then by 3)
21+
* `5` -> `15` -> `30` (split by 3, then by 2)
22+
* `5` -> `30` (split by 6)
2123

2224
Splitting works as follows:
2325

@@ -29,7 +31,7 @@ Splitting works as follows:
2931
into the new index, which is a much more time consuming process.)
3032

3133
* Once the low level files are created all documents will be `hashed` again to delete
32-
documents that belong in a different shard.
34+
documents that belong to a different shard.
3335

3436
* Finally, it recovers the target index as though it were a closed index which
3537
had just been re-opened.

0 commit comments

Comments
 (0)