How to delete Solr Index
To delete all documents from my Solr index, we have to issue an update request with the
stream.body parameter set to <delete><query>*:*</query></delete>, as with the following URL:
http://<host>:<port>/solr/update?stream.body=<delete><query>*:*</query></delete>&commit=true
Just replace the placeholder with the correct details. If executed successfully the it will return a response with status = 0 and query execution time.
<response>
If you want to remove indexes of a particular field then specify the field name in the delete query
<delete><query>desc:*</query></delete>
You can also delete a wrongly indexed value from a particular field, just by adding the value in the delete query
<delete><query>desc:wrold</query></delete>
http://<host>:<port>/solr/update?stream.body=<delete><query>*:*</query></delete>&commit=true
Just replace the placeholder with the correct details. If executed successfully the it will return a response with status = 0 and query execution time.
<response>
</response>
If you want to remove indexes of a particular field then specify the field name in the delete query
<delete><query>desc:*</query></delete>
You can also delete a wrongly indexed value from a particular field, just by adding the value in the delete query
<delete><query>desc:wrold</query></delete>
Comments
Post a Comment