Description Usage Arguments Examples
View source: R/collection_migrate.R
Migrate documents to another collection
1 2 3 4 5 6 7 8 9 10 |
conn |
A solrium connection object, see SolrClient |
name |
(character) The name of the core to be created. Required |
target.collection |
(character) Required. The name of the target collection to which documents will be migrated |
split.key |
(character) Required. The routing key prefix. For example, if uniqueKey is a!123, then you would use split.key=a! |
forward.timeout |
(integer) The timeout (seconds), until which write requests
made to the source collection for the given |
async |
(character) Request ID to track this action which will be processed asynchronously |
raw |
(logical) If |
callopts |
curl options passed on to crul::HttpClient |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ## 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")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.