I have a SOLR schema.xml like this:
<field name="cartype" type="lowercase" indexed="true" stored="true"/> <field name="color" type="lowercase" indexed="true" stored="true"/>
I want to delete "blue" and "stationwagon" tagged records from SOLR database with a curl command.
But I didn't do that with following command :
curl http://46.231.77.98:7979/solr/update/?commit=true -H "Content-Type: text/xml" -d "<delete>(cartype:stationwagon)AND(color:blue)</delete>"
Do you have any suggestions?
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.
By adding content to an index, we make it searchable by Solr. A Solr index can accept data from many different sources, including XML files, comma-separated value (CSV) files, data extracted from tables in a database, and files in common file formats such as Microsoft Word or PDF.
You have to add query
tag.
<delete><query>(cartype:stationwagon)AND(color:blue)</query></delete>
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