Clear all synonyms

Required API Key: any key with the editSettings ACL
Method signature
$index->clearSynonyms(forwardToReplicas);
Method signature
index.clear_synonyms(forwardToReplicas)
Method signature
index.clearSynonyms({ forwardToReplicas: forwardToReplicas }, callback);
Method signature
index.clear_synonyms(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.ClearSynonyms(forwardToReplicas)
Method signature
index.clearSynonyms(forwardToReplicas)
Method signature
index.ClearSynonyms(forwardToReplicas)
Method signature
clear.synonyms(of).index("toto").and(forwardToReplicas)

About this method

Remove all synonyms from an index.

This is a convenience method to delete all synonyms at once.

This Clear All method should not be used on a production index to push a new list of synonyms because it will result in a short down period during which the index would have no synonyms at all. Instead, use the batch method (with replaceExistingSynonyms set to true) to atomically replace all synonyms of an index with no down time.

Examples

Clear all synonyms and forward to replicas

<?php
$index->clearSynonyms(true);
# Clear synonyms and forward to replicas
forward_to_replicas = true

index.clear_synonyms(forward_to_replicas)
index.clearSynonyms({ forwardToReplicas: true }, function(err, content) {
  if (err) throw err;

  console.error(err);
});
# Clear synonyms and forward to replicas
index.clear_synonyms(forward_to_replicas=True)
forwardToReplicas = true;
index.ClearSynonyms(forwardToReplicas);
// Sync & Async version

boolean forwardToReplicas = true;

index.clearSynonyms(forwardToReplicas);
res, err := index.ClearSynonyms(true)
client.execute {
  clear synonyms of index "index_name" and forwardToReplicas
}

Parameters

forwardToReplicas
type: boolean
optional
default: false

Will delete synonyms on all replicas. Without this parameter, or by setting it to false, the method sill apply the change only to the specified index. If you want to forward your deletes 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

{
  "updatedAt":"2013-01-18T15:33:13.556Z",
  "taskID": 678
}
updatedAt
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