# NOT RUN {
# start Solr with Schemaless mode via the schemaless eg:
# bin/solr start -e schemaless
# you can create a new core like: bin/solr create -c corename
# where <corename> is the name for your core - or creaate as below
# connect
(conn <- SolrClient$new())
# Swap a core
## First, create two cores
conn$core_create("swapcoretest1")
# - or create on CLI: bin/solr create -c swapcoretest1
conn$core_create("swapcoretest2")
# - or create on CLI: bin/solr create -c swapcoretest2
## check status
conn$core_status("swapcoretest1", FALSE)
conn$core_status("swapcoretest2", FALSE)
## swap core
conn$core_swap("swapcoretest1", "swapcoretest2")
## check status again
conn$core_status("swapcoretest1", FALSE)
conn$core_status("swapcoretest2", FALSE)
# }
Run the code above in your browser using DataLab