Delete synonym

Required API Key: any key with the editSettings ACL
Method signature
$index->deleteSynonym(objectID, forwardToReplicas)
Method signature
index.delete_synonym(objectID, forwardToReplicas)
Method signature
index.deleteSynonym(objectID, { forwardToReplicas: forwardToReplicas }, callback)
Method signature
index.delete_synonym(objectID, forwardToReplicas)
Method signature
This method is not available in mobile API clients.

Synonyms need to be configured via
the Algolia Dashboard or with one of our backend API clients.

Method signature
This method is not available in mobile API clients.

Synonyms need to be configured via
the Algolia Dashboard or with one of our backend API clients.

Method signature
index.DeleteSynonym(objectID, forwardToReplicas)
Method signature
index.deleteSynonym(objectID, forwardToReplicas)
Method signature
index.DeleteSynonym(objectID, forwardToReplicas)
Method signature
delete.synonym(objectID).from("index_name").and(forwardToReplicas)

About this method

Remove a single synonym from an index using its object id.

Examples

<?php
// Delete and forward to replicas
$forwardToReplicas = true;

$index->deleteSynonym("a-unique-identifier", $forwardToReplicas);
# Delete and forward to replicas
forward_to_replicas = true

index.delete_synonym('a-unique-identifier', forward_to_replicas)
// Delete and forward to replicas
index.deleteSynonym(
  'a-unique-identifier',
  {
    forwardToReplicas: true
  },
  function(err, content) {
    if (err) throw err;

    console.error(err);
  }
);
# Delete and forward to replicas
index.delete_synonym('a-unique-identifier', forward_to_replicas=True)
bool forwardToReplicas = true;
index.DeleteSynonym("a-unique-identifier", forwardToReplicas);
// Sync & Async version
// Delete and forward to replicas

boolean forwardToReplicas = true;

index.deleteSynonym("a-unique-identifier", forwardToReplicas);
// Delete and forward to replicas
res, err := index.DeleteSynonym("a-unique-identifier", true)
// Delete and forward to replicas
client.execute {
  delete synonym "a-unique-identifier" from "index_name" and forwardToReplicas
}

Parameters

objectID
type: string
Required

objectID of the synonym to delete

forwardToReplicas
type: boolean
optional
default: false

Will delete synonym on all replicas. Without this parameter, or by setting it to false, the method still applies the change only to the specified index. If you want to forward the delete to your replicas you will need to set this parameter to true.

Response

In this section we document the JSON response returned by the API. Each language will encapsulate this response inside objects specific to the language and/or the implementation. So the actual type in your language might differ from what is documented.

JSON format

{
  "deletedAt":"2013-01-18T15:33:13.556Z",
  "taskID": 678
}
deletedAt
string

Date at which the indexing job has been created.

taskID
integer

The taskID used with the waitTask method.

Php small white
PHP
Ruby small white
Ruby
Javascript small white
JavaScript
Python small white
Python
Swift small white
iOS
Android small white
Android
Csharp small white
C#
Java small white
Java
Go small white
Go
Scala small white
Scala
Php small white
PHP
Ruby small white
Ruby
Javascript small white
JavaScript
Python small white
Python
Swift small white
iOS
Android small white
Android
Csharp small white
C#
Java small white
Java
Go small white
Go
Scala small white
Scala