Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

collection_balanceshardunique

Balance a property


Description

Insures that a particular property is distributed evenly amongst the physical nodes that make up a collection. If the property already exists on a replica, every effort is made to leave it there. If the property is not on any replica on a shard one is chosen and the property is added.

Usage

collection_balanceshardunique(conn, name, property,
  onlyactivenodes = TRUE, shardUnique = NULL, raw = FALSE, ...)

Arguments

conn

A solrium connection object, see SolrClient

name

(character) The name of the core to be created. Required

property

(character) Required. The property to balance. The literal "property." is prepended to this property if not specified explicitly.

onlyactivenodes

(logical) Normally, the property is instantiated on active nodes only. If FALSE, then inactive nodes are also included for distribution. Default: TRUE

shardUnique

(logical) Something of a safety valve. There is one pre-defined property (preferredLeader) that defaults this value to TRUE. For all other properties that are balanced, this must be set to TRUE or an error message is returned

raw

(logical) If TRUE, returns raw data

...

You can pass in parameters like property.name=value to set core property name to value. See the section Defining core.properties for details on supported properties and values. (https://lucene.apache.org/solr/guide/8_2/defining-core-properties.html)

Examples

## Not run: 
(conn <- SolrClient$new())

# create collection
if (!conn$collection_exists("addrep")) {
  conn$collection_create(name = "mycollection")
  # OR: bin/solr create -c mycollection
}

# balance preferredLeader property
conn$collection_balanceshardunique("mycollection", property = "preferredLeader")

# examine cluster status
conn$collection_clusterstatus()$cluster$collections$mycollection

## End(Not run)

solrium

General Purpose R Interface to 'Solr'

v1.1.4
MIT + file LICENSE
Authors
Scott Chamberlain [aut, cre] (<https://orcid.org/0000-0003-1444-9135>), rOpenSci [fnd] (https://ropensci.org/)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.