Skip to content

Unable to delete virtual replica #1377

Open
@lamontadams

Description

@lamontadams

How does one go about deleting a virtual replica index?

Looking at the published documentation at

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions