One of the most common things you will need to do when you are starting with your own experiments is to clean the index, deleting all the documents in it. This is a very common case when you want a fresh start with the data, to be able to see more clearly what is happening, or just because you are writing a script for updating your index and you want to test it, in order to make its behavior repeatable:
>> curl -X POST 'http://localhost:8983/solr/simple/update?commit=true' -H 'Content-Type: text/xml' --data-binary '<delete><query>*:*</query></delete>'
XML
data can be also saved to a file.We can easily delete Solr documents by using a query for selecting them. The q=*:*
parameter here tells Solr that we are searching in every field for every term occurrence, so we are obtaining all the documents, and once selected deleting them (Solr will identify them internally by their id
field).
18.189.180.43