Skip to main content
This page documents an earlier version of the API client. For the latest version, see Create or replace synonyms.
Required ACL: editSettings This method, like replaceAllObjects, guarantees zero downtime. All existing synonyms are deleted and replaced with the new ones, in a single, atomic operation.

Examples

SearchClient client = new SearchClient("YourApplicationID", "YourWriteAPIKey");
SearchIndex index = client.InitIndex("your_index_name");

List<Synonym> synonyms = /* Fetch your synonyms */

index.ReplaceAllSynonyms(synonyms);

// Or if you want to also replace synonyms on replicas
index.ReplaceAllSynonyms(synonyms, forwardToReplicas: true);

// Asynchronous
await index.ReplaceAllSynonymsAsync(synonyms, forwardToReplicas: true);

Parameters

synonyms
list
required
A list of synonyms
forwardToReplicas
boolean
default:false
Also replace synonyms on replicas
requestOptions
object
A mapping of request options to send along with the request.
I