Just trying to delete all the documents, and did this:
http://localhost:8983/solr/update?stream.body=%3Cdelete%3E%3Cquery%3E*:*%3C/query%3E%3C/delete%3E
then committed:
http://localhost:8983/solr/update?stream.body=%3Ccommit/%3E
I get the response:
<lst name="responseHeader"> <int name="status">0</int> <int name="QTime">17</int> </lst> </response>
But when I search I still get results back.
What did I do wrong?
Deleting the Document To delete documents from the index of Apache Solr, we need to specify the ID's of the documents to be deleted between the <delete></delete> tags. Here, this XML code is used to delete the documents with ID's 003 and 005. Save this code in a file with the name delete. xml.
Solr is a search server built on top of Apache Lucene, an open source, Java-based, information retrieval library. It is designed to drive powerful document retrieval applications - wherever you need to serve data to users based on their queries, Solr can work for you.
Not sure if it matters but you might encode the : too
http://localhost:8983/solr/update?stream.body=%3Cdelete%3E%3Cquery%3E*%3A*%3C%2Fquery%3E%3C%2Fdelete%3E
Another thing to try is to use the POST method (the preferred way to call update):
curl http://localhost:8983/solr/update?commit=true -H "Content-Type: text/xml" --data-binary '<delete><query>*:*</query></delete>'
I got stung with this one recently as well. Just remember that if you have updateLog is configured in solrconfig.xml, but there is no version field in the schema.xml
see https://issues.apache.org/jira/browse/SOLR-3432
I Spent a good hour on this one!!!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With