Skip to main content
This page documents an earlier version of the API client. For the latest version, see Add or delete dictionary entries.
Required ACL: editSettings

Examples

Replace stopword entries

Stopword stopword = new Stopword()
{
  ObjectID = objectId,
  Language = "en",
   Word = "upper",
};

// Synchronous
var replaceDictionaryResponse = DictionaryClient.ReplaceDictionaryEntries(algoliaDictionary, new List<DictionaryEntry>() { stopword });

// Asynchronous
var replaceDictionaryResponse = DictionaryClient.ReplaceDictionaryEntriesAsync(algoliaDictionary, new List<DictionaryEntry>() { stopword });
replaceDictionaryResponse.Wait();

Replace plural entries

Plural plural = new Plural()
{
  ObjectID = objectId,
  Language = "fr",
  Words = new List<String>() { "cheval", "chevaux" }
};

// Synchronous
DictionaryClient.ReplaceDictionaryEntries(algoliaDictionary, new List<DictionaryEntry>() { plural });

// Asynchronous
var replaceDictionaryResponse = await DictionaryClient.ReplaceDictionaryEntries(algoliaDictionary, new List<DictionaryEntry>() { plural });
replaceDictionaryResponse.Wait();

Replace compound entries

Compound compound = new Compound()
{
  ObjectID = objectId,
  Language = "nl",
  Word = "kopfschmerztablette",
  Decomposition = new List<String>() { "kopf", "schmerz", "tablette" }
 };

 // Synchronous
 var replaceDictionaryResponse = DictionaryClient.ReplaceDictionaryEntries(algoliaDictionary, new List<DictionaryEntry>() { compound });

 // Asynchronous
 var replaceDictionaryResponse = await DictionaryClient.ReplaceDictionaryEntriesAsync(algoliaDictionary, new List<DictionaryEntry>() { compound });
 replaceDictionaryResponse.Wait();

Parameters

dictionary
enum<string>
required
Dictionary type. One of: stopword, plural, compound.
dictionaryEntries
object[]
required
The dictionary entries to add.
requestOptions
object
Additional parameters to add to this request.

Response

taskID
integer
The task ID used with the waitTask method.
updatedAt
string
Date at which the indexing job has been created.

Response as JSON

This section shows the JSON response returned by the API. Each API client wraps this response in language-specific objects, so the structure may vary. To view the response, use the getLogs method. Don’t rely on the order of properties—JSON objects don’t preserve key order.
JSON
{
  "updatedAt":"2013-01-18T15:33:13.556Z",
  "taskID": 678
}
I