# NOT RUN {
(conn <- SolrClient$new())
# create collection
if (!conn$collection_exists("buffalo")) {
conn$collection_create(name = "buffalo")
# OR: bin/solr create -c buffalo
}
# find shard names
names(conn$collection_clusterstatus()$cluster$collections$buffalo$shards)
# split a shard by name
collection_splitshard(conn, name = "buffalo", shard = "shard1")
# now we have three shards
names(conn$collection_clusterstatus()$cluster$collections$buffalo$shards)
# delete shard
conn$collection_deleteshard(name = "buffalo", shard = "shard1_1")
# }
Run the code above in your browser using DataLab