val entry = DictionaryEntry.Stopword( objectID = ObjectID("MyObjectID"), language = Language.English, word = "upper")client.replaceDictionaryEntries(Dictionary.Stopwords, listOf(entry))// or using extension function:client.replaceStopwordEntries(listOf(entry))
val entry = StopwordEntry( objectID = "MyObjectID", language = "en", word = "down", state = "enabled")client.execute { replace dictionary Stopwords entries Seq(entry)}
let entry = StopwordsDictionary.Entry(objectID: "down", language: .english, word: "down", state: .enabled)client.replaceDictionaryEntries(in: StopwordsDictionary.self, with: [entry]) { result in if case .success(let response) = result { print("Response: \(response)") }}
Replace plural entries
Plural plural = new Plural(){ ObjectID = objectId, Language = "fr", Words = new List<String>() { "cheval", "chevaux" }};// SynchronousDictionaryClient.ReplaceDictionaryEntries(algoliaDictionary, new List<DictionaryEntry>() { plural });// Asynchronousvar replaceDictionaryResponse = await DictionaryClient.ReplaceDictionaryEntries(algoliaDictionary, new List<DictionaryEntry>() { plural });replaceDictionaryResponse.Wait();
val entry = DictionaryEntry.Plural( objectID = ObjectID("MyObjectID"), language = Language.French, words = listOf("cheval", "chevaux"))client.replaceDictionaryEntries(Dictionary.Plurals, listOf(entry))// or using extension function:client.replacePluralEntries(listOf(entry))
val entry = PluralEntry( objectID = "MyObjectID", language = "fr", words = Seq("cheval", "chevaux"))client.execute { replace dictionary Plurals entries Seq(entry)}
let entry = PluralsDictionary.Entry(objectID: "chevaux", language: .french, words: ["cheval", "chevaux"])client.replaceDictionaryEntries(in: PluralsDictionary.self, with: [entry]) { result in if case .success(let response) = result { print("Response: \(response)") }}
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();
val entry = DictionaryEntry.Compound( objectID = ObjectID("MyObjectID"), language = Language.Dutch, word = "kopfschmerztablette", decomposition = listOf("kopf", "schmerz", "tablette"))client.replaceDictionaryEntries(Dictionary.Compounds, listOf(entry))// or using extension function:client.replaceCompoundEntries(listOf(entry))
val entry = CompoundEntry( objectID = "MyObjectID", language = "de", word = "kopfschmerztablette", decomposition = Seq("kopf", "schmerz", "tablette"))client.execute { replace dictionary Compounds entries Seq(entry)}
let entry = CompoundsDictionary.Entry(objectID: "kopfschmerztablette", language: .german, word: "kopfschmerztablette", decomposition: ["kopf", "schmerz", "tablette"])client.replaceDictionaryEntries(in: CompoundsDictionary.self, with: [entry]) { result in if case .success(let response) = result { print("Response: \(response)") }}
Parameters
enum<string>
required
Dictionary type.
One of: stopword, plural, compound.
object[]
required
The dictionary entries to add.
Show child attributes
string
required
Unique ID of the dictionary entry.
string
required
Language ISO code supported by this dictionary,
for example en for English.
string[]
List of decompositions of a word for the compounds dictionary.
If empty, word is considered a compound atom.
Otherwise, the compounds that word is decomposed into.
enum<string>
default:"enabled"
Whether this dictionary entry is active:
enabled: this dictionary entry is active
disabled: this dictionary entry is inactive
string
For the stop-word dictionary: the stop word you want to add.
For the compounds dictionary:
Adds the word as compound atom (with empty decomposition)
Adds the word with a custom decomposition
If the word is already included in Algolia’s standard dictionary,
you can override it by setting its state to disabled.
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.