How to delete all data from solr and hbase
How do I delete all data from solr
by command? We are using solr
with lily
and hbase
.
How can I delete data from both hbase and solr?
http://lucene.apache.org/solr/4_10_0/tutorial.html#Deleting+Data
Solution 1:
If you want to clean up Solr index -
you can fire http url -
http://host:port/solr/[core name]/update?stream.body=<delete><query>*:*</query></delete>&commit=true
(replace [core name]
with the name of the core you want to delete from). Or use this if posting data xml data:
<delete><query>*:*</query></delete>
Be sure you use commit=true
to commit the changes
Don't have much idea with clearing hbase data though.
Solution 2:
I've used this request to delete all my records but sometimes it's necessary to commit this.
For that, add &commit=true
to your request :
http://host:port/solr/core/update?stream.body=<delete><query>*:*</query></delete>&commit=true
Solution 3:
Post json data (e.g. with curl)
curl -X POST -H 'Content-Type: application/json' \
'http://<host>:<port>/solr/<core>/update?commit=true' \
-d '{ "delete": {"query":"*:*"} }'