Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 455 Vote(s) - 3.43 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solr: how to delete a collection?

#1
I am using solr 4.9, not adding any additional shard, just use whatever default it comes with it. I have created a collection and tried to delete it by using the following api :

http://<host>/solr/admin/collections?action=DELETE&name=collectionName

but it returns error :

>Solr instance is not running in SolrCloud mode

My Solr is not solrCloud, but how do I delete my collection?
Reply

#2
According to this guide (

[To see links please register here]

) this API is working only, when you are in a SolrCloud mode.

If you want to just delete core or just delete all docs in that core, take a look here -

[To see links please register here]

Reply

#3
Go to the solr folder and Do this..

bin/solr delete -c collection_name

and restart solr with

bin/solr restart
Reply

#4
Or do this with the API instead:

[To see links please register here]

Reply

#5
**n.b.** Tested against **Solr 4.9**, *should* work with newer versions.

curl -v

[To see links please register here]

Reply

#6
You could use curl

curl -X GET -H "Content-Type: application/json" "http://localhost:8983/solr/admin/cores?wt=json&action=UNLOAD&core=gettingstarted"

Where *gettingstarted* is the name of the core that you want to delete.
Please note that the above assumes that _solr_ is running on port **8983**.
Reply

#7
You can delete the `Solr` Collection in two ways.

**1) From the command prompt:**

Launch the command prompt from where you have extracted the `Apache Solr`. Run the below Command

`Solr\bin>solr delete -c My_Collection`

**2) From the Solr Admin Console:**

`/admin/collections?action=DELETE&name=collection`

For more information about the `Apache Solr Collection API`.
[Apache Solr Collection API][1]


[1]:

[To see links please register here]

Reply

#8
Though Adam's response is correct, here's the documentation to help use it:

[To see links please register here]


I got stuck on this one for a while and was only getting the invalid deleting of cores answer, which, I'm guessing used to work for collections, but does not in newer versions.
Reply

#9
You can delete a collection in three ways in the recent versions of Solr.

1. You can delete the collection manually by using the `bin/solr` tool
2. You can delete the collection manually via Solr Admin
3. You can delete the collection by using the Collections API
4. You can delete the collection by using the V2 API

Deleting a collection using the `bin/solr` tool is simple. You go to your `SOLR_HOME` directory and you run:

bin/solr delete -c COLLECTION_NAME

To delete a collection using the Collections API you would run a command like this:

curl 'localhost:8983/solr/admin/collections?action=DELETE&name=COLLECTION_NAME'

Finally, to use the V2 API and delete a collection using it you would do the following:

curl -XDELETE 'http://localhost:8983/api/c/COLLECTION_NAME'

If you plan on removing the collection very rarely, you can do that manually. If that is something commonly used - for example with aliases and time-based data I would suggest using the V2 API as this is the newest one and will probably replace the old APIs at some point.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through