# NOT RUN {
(conn <- SolrClient$new())
# create collection
if (!conn$collection_exists("migrate_from")) {
conn$collection_create(name = "migrate_from")
# OR: bin/solr create -c migrate_from
}
# create another collection
if (!conn$collection_exists("migrate_to")) {
conn$collection_create(name = "migrate_to")
# OR bin/solr create -c migrate_to
}
# add some documents
file <- system.file("examples", "books.csv", package = "solrium")
x <- read.csv(file, stringsAsFactors = FALSE)
conn$add(x, "migrate_from")
# migrate some documents from one collection to the other
## FIXME - not sure if this is actually working....
# conn$collection_migrate("migrate_from", "migrate_to", split.key = "05535")
# }
Run the code above in your browser using DataLab