algolia / algolia/algoliasearch-client-javascript
Unable to delete virtual replica
- Dominant language
- TypeScript
- Stars
- 1.4k
- Forks
- 226
- PR merge metrics
- No merged PRs in 30d
Description
How does one go about deleting a virtual replica index?
Looking at the published documentation at
- https://www.algolia.com/doc/api-client/methods/indexing/#creating-indices
- https://www.algolia.com/doc/api-reference/api-methods/delete-index/
- https://www.algolia.com/doc/guides/managing-results/refine-results/sorting/how-to/deleting-replicas/#using-the-api
It seems as though this should work, assuming a "main" index named "main" and a virtual replica named "virtual":
```
const client = algoliaSearch(ID, KEY);
const main = client.initIndex('main');
await main.setSettings({
replicas: []
});
const virtualIndex = client.initIndex('virtual');
await virtualIndex.delete();
```
However, the call to `initIndex` for `'virtual'` yields this error response:
```
{
name: 'ApiError',
message: 'cannot apply a add object request on a replica index',
status: 403,
}
```
Is there some way other than `initIndex` that I'm supposed to be getting a reference to a virtual replica index?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.