Replica indices are helpful, but take up space in your allowed number of records. You can delete a replica through the API or your Algolia dashboard.
Using the API
To delete a replica index through the API, you need to use the setSettings method on the original index to unlink the replica, then use the deleteIndex method on the replica index to delete it.
In the below example, we want to delete the products_price_asc replica.
If the primary index has other replica indices which you don’t want to unlink, they should remain in the replicas parameter.
primary_index.setSettings(["replicas":[]])client.deleteIndex(withName:"products_price_asc",completionHandler:{(content,error)->Voidiniferror!=nil{print("Could not delete: \(error!)")}})
IndexSettingssettings=newIndexSettings{Replicas=newList<string>{}};// Set Settings--Synchronousprimary_index.SetSettings(settings);// Set Settings--Asynchronousawaitprimary_index.SetSettingsAsync(settings);// Deletion--Synchronousproducts_price_asc.Delete();// Deletion--Asynchronousawaitproducts_price_asc.DeleteAsync();