During application development, you might use sample data that is inappropriate for the production system. To remove this data, you can delete the entire index or just delete the content and crawl history for a single data source.
The easiest way to do this is to use the Admin UI to delete documents from a specific data source or an entire collection.
Another way to do this is to issue an API command using the Collections Index API. This API provides two methods to stop all running indexing tasks, clear the index, and clear any persistent crawl data (crawl history) for either the entire collection or a single data source.
| This Will Delete ALL of Your Data The following procedure to delete a collection should only be used if you are sure you want to delete all documents in your index. Once this command has been executed, there is no way to retrieve the content. If only some documents should be deleted, use the method to delete documents for a specific data source. |
If you only want to clear the crawl history, the Data Source Crawl Data API provides a way to delete only the history for a data source, but not the content.
An alternative approach would be to issue a delete command directly to Solr with the following syntax. However, this will not stop running tasks nor clear persistent crawl data.
http://localhost:8888/solr/update?stream.body=<delete><query>id:\[\* TO \*\]</query></delete>