Cogs and Levers A blog full of technical stuff

Purging all of the data within Solr

During the test phases of getting your software setup, you’ll find it useful to completely toast what ever data you’ve already indexed to start fresh. This is as simple as issuing a delete query with open criteria *.*. The full query should translate to

<delete><query>*.*</query></delete>

As a URL it’ll look like this:

http://[your solr server]:8080/solr/update?stream.body=%3Cdelete%3E%3Cquery%3E*:*%3C/query%3E%3C/delete%3E&commit=true

Note that there is a commit at the end of this URL which will perform the delete and commit the result all in the one invocation.