SearchStax Help Center


How to Empty a Solr Index

During early development it is common to discard an index and reload the data under a new schema. Our SearchStax Managed Search service customers often ask us how to “drop” or empty a Solr index.

You can either do that by deleting all data, or my deleting the collection/index and then re-creating it.

Delete all data/ Empty a Collection (an Index)

To delete all documents from an Index, execute the update API and pass the query to delete all documents as shown below:

curl -u <read-write user name>:<read-write user password> -X POST -H 'Content-type:application/json' -d '{"delete":{"query":"*:*"}}' "https://ss1859999-us-east-2-aws.searchstax.com/solr/film/update?commit=true"

Delete a Collection (an Index)

To delete a collection (all parts of the same index on all nodes) open the Solr Dashboard and navigate to the Collections node:

SearchStax Empty Solr Index

Select the appropriate collection and use the Delete button. (Be sure to note the Shard count, configName, and replicationFactor settings.)

Recreate the Collection

Return to the Collections node and click the Add Collection button.

SearchStax Empty Solr Index

Fill in the appropriate parameters for the new collection. Note that numShards is almost always 1. ReplicationFactor is the number of Solr nodes in your deployment.

Next Step

Don’t overlook the fact that you have to reload your data into the collection.

Questions?

Do not hesitate to contact the SearchStax Support Desk.


Return to Frequently Asked Questions.