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 />

9<br />

<br />

<br />

Balance a Property<br />

/admin/collections?action=BALANCESHARDUNIQUE&collection= collectionName&property=<br />

pro<br />

pertyName<br />

Insures that a particular property is distributed evenly amongst the physical nodes that make up a collection. If<br />

the property already exists on a replica, every effort is made to leave it there. If the property is not on any replica<br />

on a shard one is chosen and the property is added.<br />

Input<br />

Query Parameters<br />

Key Type Required Description<br />

collection string Yes The name of the collection to balance the property in.<br />

property string Yes The property to balance. The literal "property." is prepended to this<br />

property if not specified explicitly.<br />

onlyactivenodes boolean No Defaults to true. Normally, the property is instantiated on active nodes<br />

only. If this parameter is specified as "false", then inactive nodes are<br />

also included for distribution.<br />

shardUnique boolean No Something of a safety valve. There is one pre-defined property<br />

(preferredLeader) that defaults this value to "true". For all other<br />

properties that are balanced, this must be set to "true" or an error<br />

message is returned.<br />

Output<br />

Output Content<br />

The response will include the status of the request. If the status is anything other than "0", an error message will<br />

explain why the request failed.<br />

Examples<br />

Input: Either of these commands would put the "preferredLeader" property on one replica in every shard in the<br />

"collection1" collection.<br />

http://localhost:8983/solr/admin/collections?action=BALANCESHARDUNIQUE&collection=co<br />

llection1&property=preferredLeader<br />

http://localhost:8983/solr/admin/collections?action=BALANCESHARDUNIQUE&collection=co<br />

llection1&property=property.preferredLeader<br />

Output:<br />

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

594

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

Saved successfully!

Ooh no, something went wrong!