In the Algolia dashboard, you can delete replica indices like regular indices.
For more information, see Delete indices in the Algolia dashboard .
Using the API, you can delete a replica index in two steps:
Unlink the replica index from its primary.
This turns the replica into a regular index.
Delete the (former) replica index.
Unlink replica indices with the API
To unlink a replica index from its primary index,
remove it from the replicas setting of the primary index,
using the setSettings method:
1
2
3
4
var response = await client . SetSettingsAsync (
"ALGOLIA_INDEX_NAME" ,
new IndexSettings { Replicas = new List < string > { "" } }
);
1
2
3
4
5
6
7
8
final response = await client . setSettings (
indexName: "ALGOLIA_INDEX_NAME" ,
indexSettings: IndexSettings (
replicas: [
"" ,
],
),
);
1
2
3
4
5
6
7
8
response , err := client . SetSettings ( client . NewApiSetSettingsRequest (
"ALGOLIA_INDEX_NAME" ,
search . NewEmptyIndexSettings () . SetReplicas (
[] string { "" })))
if err != nil {
// handle the eventual error
panic ( err )
}
1
client . setSettings ( "ALGOLIA_INDEX_NAME" , new IndexSettings (). setReplicas ( Arrays . asList ( "" )));
1
const response = await client . setSettings ({ indexName : ' theIndexName ' , indexSettings : { replicas : [ '' ] } });
1
2
3
4
5
6
var response = client . setSettings (
indexName = "ALGOLIA_INDEX_NAME" ,
indexSettings = IndexSettings (
replicas = listOf ( "" ),
),
)
1
2
3
4
5
6
7
$response = $client -> setSettings (
'ALGOLIA_INDEX_NAME' ,
[ 'replicas' => [
'' ,
],
],
);
1
2
3
4
5
6
7
8
response = client . set_settings (
index_name = "ALGOLIA_INDEX_NAME" ,
index_settings = {
"replicas" : [
"" ,
],
},
)
1
response = client . set_settings ( "ALGOLIA_INDEX_NAME" , Algolia :: Search :: IndexSettings . new ( replicas: [ "" ]))
1
2
3
4
5
6
7
8
9
val response = Await . result (
client . setSettings (
indexName = "ALGOLIA_INDEX_NAME" ,
indexSettings = IndexSettings (
replicas = Some ( Seq ( "" ))
)
),
Duration ( 100 , "sec" )
)
1
2
3
4
let response = try await client . setSettings (
indexName : "ALGOLIA_INDEX_NAME" ,
indexSettings : IndexSettings ( replicas : [ "" ])
)
If want to keep other replicas,
don’t remove them from the replicas setting.
If you set replicas to an empty string or list,
all replicas will be unlinked.
Now, you can delete your replica index .
© Algolia · Privacy Policy · Cookie settings