How to delete SOLR indexed data by query with curl? How to delete SOLR indexed data by query with curl? curl curl

How to delete SOLR indexed data by query with curl?


You have to add query tag.

<delete><query>(cartype:stationwagon)AND(color:blue)</query></delete>


In this way would be easier: curl "http://46.231.77.98:7979/solr/collection/update/?commit=true&stream.body=<delete><query>(cartype:stationwagon)AND(color:blue)</query></delete>"

It's a simple GET request and you have just to add the parameter
stream.body=<delete><query>(cartype:stationwagon)AND(color:blue)</query></delete> to the query string.


Using JSON instead of XML:

curl -g "http://localhost:8983/solr/$core/update" \     -H 'Content-Type: application/json' \     -d '{"delete":{"query":"field:value"}}'