---
title: "Clean up the rebuild index"
slug: "clean-up-the-rebuild-index"
abstract: "How to clean up the Solr rebuild index with the Sitecore IndexWorker CleanupRebuildIndex command."
---
# Clean up the rebuild index

To save space, you can delete deprecated index data from the Solr rebuild core [after the live and the rebuild cores have been swapped](https://doc.sitecore.com/xp/en/developers/103/sitecore-experience-platform/rebuild-the-xdb-index-in-solr.html "Rebuild the xDB index in Solr"). In Sitecore 9.3 and later, this operation is easier with a new `IndexWorker` command.

The new `IndexWorker` command initiates a cleanup of the Solr rebuild core. In case of an ongoing rebuild, the command returns the message: *There is an ongoing rebuild. Finish the rebuild before cleaning the rebuild index.*

To clean the Solr rebuild core:

1. Go to the folder where the xConnect Search Indexer is located. For example: `C:\inetpub\wwwroot\App_Data\jobs\continuous\IndexWorker\`
2. Execute the command: `.\Sitecore.XConnectSearchIndexer.exe -cri`

    > [!note]
    > The `-cri` argument is short for Cleanup Rebuild Index. You can also type `-CleanupRebuildIndex`.