Gary Sieling

URLs to unload and reload Solr cores via curl

It’s useful to be able to unload and reload Solr cores via curl, so you can deploy new versions of the index through a build process. You can do this12

curl "http://localhost:8983/solr/admin/cores?action=UNLOAD&core=talks"
curl "http://localhost:8983/solr/admin/cores?action=CREATE&name=talks"

There is also a “RELOAD”, although I’m not sure how this is useful.

If you unload the core, it unlocks it (otherwise there is a file called index.lock that is left behind, preventing you loading the core).

If you want to copy the core to another machine, you can tar the folder with the core:

tar cvf talks/

If you move this to another machine, you will need to set the permissions to match what your machine was configured with. Solr needs write access to the core, even though you may not allow writes, because it creates the index.lock file when it loads back up.

tar xvf talks.tar
chown -R solr:solr talks
  1. http://stackoverflow.com/questions/21619947/create-new-cores-in-solr-via-http []
  2. http://stackoverflow.com/questions/11540434/reload-solr-core-with-curl []
Exit mobile version