Created
December 8, 2014 00:49
-
-
Save krusynth/64e88d9a9769aed818e6 to your computer and use it in GitHub Desktop.
Bash script to delete all documents from a Solr core.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Put this at the end of your .bash_profile. | |
# | |
# Usage: clearsolr corename | |
clearsolr() { | |
curl http://localhost:8983/solr/$1/update -H "Content-type: text/xml" --data-binary '<delete><query>*:*</query></delete>' | |
curl http://localhost:8983/solr/$1/update -H "Content-type: text/xml" --data-binary '<commit />' | |
curl http://localhost:8983/solr/$1/update -H "Content-type: text/xml" --data-binary '<optimize />' | |
curl http://localhost:8983/solr/$1/update -H "Content-type: text/xml" --data-binary '<commit />' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment