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

collection_addreplica

Add a replica


Description

Add a replica to a shard in a collection. The node name can be specified if the replica is to be created in a specific node

Usage

collection_addreplica(conn, name, shard = NULL, route = NULL,
  node = NULL, instanceDir = NULL, dataDir = NULL, async = NULL,
  raw = FALSE, callopts = list(), ...)

Arguments

conn

A solrium connection object, see SolrClient

name

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

shard

(character) The name of the shard to which replica is to be added. If shard is not given, then route must be.

route

(character) If the exact shard name is not known, users may pass the route value and the system would identify the name of the shard. Ignored if the shard param is also given

node

(character) The name of the node where the replica should be created

instanceDir

(character) The instanceDir for the core that will be created

dataDir

(character) The directory in which the core should be created

async

(character) Request ID to track this action which will be processed asynchronously

raw

(logical) If TRUE, returns raw data

callopts

curl options passed on to crul::HttpClient

...

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("foobar")) {
  conn$collection_create(name = "foobar", numShards = 2)
  # OR bin/solr create -c foobar
}

# status
conn$collection_clusterstatus()$cluster$collections$foobar

# add replica
if (!conn$collection_exists("foobar")) {
  conn$collection_addreplica(name = "foobar", shard = "shard1")
}

# status again
conn$collection_clusterstatus()$cluster$collections$foobar
conn$collection_clusterstatus()$cluster$collections$foobar$shards
conn$collection_clusterstatus()$cluster$collections$foobar$shards$shard1

## 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.