11.05.2016 Views

Apache Solr Reference Guide Covering Apache Solr 6.0

21SiXmO

21SiXmO

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<br />

0<br />

1551<br />

<br />

<br />

<br />

<br />

0<br />

761<br />

<br />

<br />

<br />

<br />

0<br />

1527<br />

<br />

<br />

<br />

<br />

Split a Shard<br />

/admin/collections?action=SPLITSHARD&collection= name&shard=<br />

shardID<br />

Splitting a shard will take an existing shard and break it into two pieces which are written to disk as two (new)<br />

shards. The original shard will continue to contain the same data as-is but it will start re-routing requests to the<br />

new shards. The new shards will have as many replicas as the original shard. A soft commit is automatically<br />

issued after splitting a shard so that documents are made visible on sub-shards. An explicit commit (hard or soft)<br />

is not necessary after a split operation because the index is automatically persisted to disk during the split<br />

operation.<br />

This command allows for seamless splitting and requires no downtime. A shard being split will continue to accept<br />

query and indexing requests and will automatically start routing them to the new shards once this operation is<br />

complete. This command can only be used for <strong>Solr</strong>Cloud collections created with "numShards" parameter,<br />

meaning collections which rely on <strong>Solr</strong>'s hash-based routing mechanism.<br />

The split is performed by dividing the original shard's hash range into two equal partitions and dividing up the<br />

documents in the original shard according to the new sub-ranges.<br />

One can also specify an optional 'ranges' parameter to divide the original shard's hash range into arbitrary hash<br />

range intervals specified in hexadecimal. For example, if the original hash range is 0-1500 then adding the<br />

parameter: ranges=0-1f4,1f5-3e8,3e9-5dc will divide the original shard into three shards with hash range 0-500,<br />

501-1000 and 1001-1500 respectively.<br />

Another optional parameter 'split.key' can be used to split a shard using a route key such that all documents of<br />

the specified route key end up in a single dedicated sub-shard. Providing the 'shard' parameter is not required in<br />

this case because the route key is enough to figure out the right shard. A route key which spans more than one<br />

shard is not supported. For example, suppose split.key=A! hashes to the range 12-15 and belongs to shard<br />

'shard1' with range 0-20 then splitting by this route key would yield three sub-shards with ranges 0-11, 12-15 and<br />

16-20. Note that the sub-shard with the hash range of the route key may also contain documents for other route<br />

keys whose hash ranges overlap.<br />

Shard splitting can be a long running process. In order to avoid timeouts, you should run this as an asynchronou<br />

s call.<br />

Input<br />

<strong>Apache</strong> <strong>Solr</strong> <strong>Reference</strong> <strong>Guide</strong> <strong>6.0</strong><br />

570

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!