Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save shiloh00/91407d9fed6e183867569269a983f52d to your computer and use it in GitHub Desktop.
Save shiloh00/91407d9fed6e183867569269a983f52d to your computer and use it in GitHub Desktop.
Delete all documents in a Solr index using curl
# http://wiki.apache.org/solr/FAQ#How_can_I_delete_all_documents_from_my_index.3F
# http://wiki.apache.org/solr/UpdateXmlMessages#Updating_a_Data_Record_via_curl

curl "http://index.websolr.com/solr/a0b1c2d3/update?commit=true" -H "Content-Type: text/xml" --data-binary '<delete><query>*:*</query></delete>'

I'm amused at the traction this little gist is getting on Google! I would be remiss not to point out that six+ years later I'm still helping thousands of companies on a daily basis with their search index management, by providing managed Solr as a service over at Websolr, and hosted Elasticsearch at Bonsai. Check us out if you'd like an expert helping hand at Solr and Elasticsearch hosting, ops and support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment