Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove core from Datastax Solr

I have a Cassandra table for which I have enabled Solr indexing, using command

dsetool create_core <keyspace>.<table> [<option> ...]

Question is how to delete this core?

I have tried unload via HTTP Api which returned UNLOAD unsupported!

like image 329
Babu James Avatar asked Sep 08 '15 12:09

Babu James


2 Answers

Update,

unload_core is now avaliable as of DSE 4.8 -- DSP-1533

Verbatim from the DataStax docs

Unloading a Solr core To disable full text search on a core, unload the core without removing its backing table.

To simplify Solr code unloading, use dsetool unload_core. The syntax of the command is:

$ dsetool unload_core . [ ...] where is one or more of the following options: Option Settings Default Description of default setting deleteDataDir= true or false false Retains the underlying Cassandra data. deleteResources= true or false false Retains the core configuration and schema resources. distributed= true or false true Deletes resources and data across the cluster. The distributed option governs the removal of data and resources. The Solr secondary indexes on the backing table are removed through Cassandra schema propagation even if distributed=false. Note: If one or more nodes fail to unload the core in distributed operations, an error message indicates the failing node or nodes. Issue the unload again.

like image 143
phact Avatar answered Sep 20 '22 23:09

phact


Core unloading support exists in DSE 4.8, as another answer now mentions. For DSE 4.7 and older, you'll want to perform the following steps:

  1. From cqlsh, remove all custom secondary indexes from the table that backs your Solr core.
  2. (optional) From cqlsh, remove Solr resources for the core in question, like schema.xml and solrconfig.xml from the table solr_admin.solr_resources.
  3. (optional) Delete the contents of /solr.data/.

After performing step 1, no further indexing will occur on the node, and after performing steps 2 & 3 and restarting, there will be no trace of the core left.

Note: At the end of this process, the Cassandra table that backed your core should still be available.

like image 22
Caleb Rackliffe Avatar answered Sep 17 '22 23:09

Caleb Rackliffe