Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete all data from solr and hbase

Tags:

solr

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

like image 977
XMen Avatar asked Oct 11 '11 07:10

XMen


People also ask

How do I delete all data from Solr collection?

Deleting All Documents Just like deleting a specific field, if you want to delete all the documents from an index, you just need to pass the symbol “:” between the tags <query></ query>, as shown below. Save it as delete_all. xml and perform the delete operation on the core named my_core using the post tool of Solr.

How do I delete Solr?

Options for the solr delete command For the solr delete command the -c <name> option is required while the other options (parameters) are optional. Delete the named Solr core or collection with default options. Solr will delete the specified core and its associated configuration files at the first port number found.

How do I reindex Solr?

There is no process in Solr for programmatically reindexing data. When we say "reindex", we mean, literally, "index it again". However you got the data into the index the first time, you will run that process again.


2 Answers

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.

like image 92
Jayendra Avatar answered Sep 25 '22 06:09

Jayendra


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 
like image 28
Showtim3 Avatar answered Sep 26 '22 06:09

Showtim3