Skip to content

Instantly share code, notes, and snippets.

@erochest
Forked from waynegraham/gist:2355797
Created April 12, 2012 15:11
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 erochest/2368019 to your computer and use it in GitHub Desktop.
Save erochest/2368019 to your computer and use it in GitHub Desktop.
Delete solr index with curl
curl http://localhost:8983/solr/update?commit=true -H "Content-Type: text/xml" --data-binary '<delete><query>*:*</query></delete>'
#!/bin/bash
URL=$1
curl $URL/update -H "Content-Type: text/xml" --data-binary '<delete><query>*:*</query></delete>'
if [ $? != 0 ]; then
echo "ERROR. Bailing."
return $?
else
curl $URL/update?commit=true
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment