Skip to content

Instantly share code, notes, and snippets.

@krusynth
Created November 8, 2013 15:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krusynth/7372880 to your computer and use it in GitHub Desktop.
Save krusynth/7372880 to your computer and use it in GitHub Desktop.
Clear solr on localhost. Throw this in your .bash_profile or .bashrc and use `clearsolr *instancename*`
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