Howto clear Solr index


If you want to delete all items from Solr index, use the query

<delete><query>*:*</query></delete>

as described in the FAQ on the Solr Wiki.

But how do you actually send this query? You can use this command:

curl http://<host>:<port>/<solr_base>/update?commit=true -d '<delete><query>*:*</query></delete>'

Just replace the placeholders with the right values, e.g.

curl http://localhost:8983/solr/update?commit=true -d  '<delete><query>*:*</query></delete>'

If Solr responds with something like this:

HTTP Status 400 - missing content stream
Status report
message missing content stream
description The request sent by the client was syntactically incorrect (missing content stream).

then you are probably missing the commit parameter i.e. ?commit=true