eZ Publish / eZ Find Extension: How to clear Solr index

When developing on eZ Publish and the project uses eZFind extension we often need to clear the Solr index.

The following command line will delete everything from the solr index (so please make sure you type the command on the right terminal window :) )

# curl http://localhost:8983/solr/update?commit=true -H "Content-Type: text/xml" --data-binary '<delete><query>*:*</query></delete>'

Check if the command worked by:

# curl http://localhost:8983/solr/select/?q=*%3A*

which query for all solr documents and lookup for

<result name="response" numFound="0" start="0"/>

which tell you no results returned.