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();
stopwordEntry := search.NewStopword(entryID, "en", "down", "enabled")
res, err := client.ReplaceDictionaryEntries(search.Stopwords, []search.DictionaryEntry{stopwordEntry})
Stopword stopword = DictionaryEntry.stopword("MyObjectID", "en", "down", "enabled");
// Synchronous
searchClient.replaceDictionaryEntries(Dictionary.STOPWORDS, Collections.singletonList(stopword));
// Asynchronous
searchClient.replaceDictionaryEntriesAsync(Dictionary.STOPWORDS, Collections.singletonList(stopword));
client.replaceDictionaryEntries("stopwords", [
{
objectID: "down",
language: "de",
word: "down",
},
]);
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))
$client->replaceDictionaryEntries(
'stopwords',
array(array(
'objectID' => 'down',
'language' => 'en',
'word' => 'down'
))
);
client.replace_dictionary_entries(
"stopwords", [{"objectID": "down", "language": "en", "word": "down"}]
)
client.replace_dictionary_entries(
"stopwords",
[
{
objectID: "down",
language: "en",
word: "down"
}
]
)
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" }
};
// Synchronous
DictionaryClient.ReplaceDictionaryEntries(algoliaDictionary, new List<DictionaryEntry>() { plural });
// Asynchronous
var replaceDictionaryResponse = await DictionaryClient.ReplaceDictionaryEntries(algoliaDictionary, new List<DictionaryEntry>() { plural });
replaceDictionaryResponse.Wait();
pluralEntry := search.NewPlural(entryID, "fr", []string{"cheval", "chevaux"})
res, err := client.ReplaceDictionaryEntries(search.Plurals, []search.DictionaryEntry{pluralEntry})
Plural plural = DictionaryEntry.plural("MyObjectID", "fr", Arrays.asList("cheval", "chevaux"));
// Synchronous
client.replaceDictionaryEntries(Dictionary.PLURALS, Collections.singletonList(plural));
// Asynchronous
client.replaceDictionaryEntriesAsync(Dictionary.PLURALS, Collections.singletonList(plural));
client.replaceDictionaryEntries("plurals", [
{
objectID: "chevaux",
language: "fr",
words: ["cheval", "chevaux"],
},
]);
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))
$client->replaceDictionaryEntries(
'plurals',
array(array(
'objectID' => 'chevaux',
'language' => 'fr',
'words' => array('cheval', 'chevaux')
))
);
client.replace_dictionary_entries(
"plurals",
[{"objectID": "chevaux", "language": "fr", "words": ["cheval", "chevaux"]}],
)
client.replace_dictionary_entries(
"plurals",
[
{
objectID: "chevaux",
language: "fr",
words: %w[cheval chevaux]
}
]
)
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();
compoundEntry := search.NewCompound(entryID, "de", "kopfschmerztablette", []string{"kopf", "schmerz", "tablette"})
res, err := client.ReplaceDictionaryEntries(search.Compounds, []search.DictionaryEntry{compoundEntry})
Compound compound = DictionaryEntry.compound("MyObjectID", "de", "kopfschmerztablette",Arrays.asList("kopf", "schmerz", "tablette"));
// Synchronous
client.replaceDictionaryEntries(Dictionary.COMPOUNDS, Collections.singletonList(compound));
// Asynchronous
client.replaceDictionaryEntriesAsync(Dictionary.COMPOUNDS, Collections.singletonList(compound));
client.replaceDictionaryEntries("compounds", [
{
objectID: "kopfschmerztablette",
language: "de",
word: "kopfschmerztablette",
decomposition: ["kopf", "schmerz", "tablette"],
},
]);
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))
$client->replaceDictionaryEntries(
'compounds',
array(array(
'objectID' => 'kopfschmerztablette',
'language' => 'de',
'word' => 'kopfschmerztablette',
'decomposition' => array('kopf', 'schmerz', 'tablette')
))
);
client.replace_dictionary_entries(
'compounds',
[{
'objectID': 'kopfschmerztablette',
'language': 'de',
'word': 'kopfschmerztablette',
'decomposition': ['kopf', 'schmerz', 'tablette]
}]
)
client.replace_dictionary_entries(
"compounds",
[
{
objectID: "kopfschmerztablette",
language: "de",
word: "kopfschmerztablette",
decomposition: %w[kopf schmerz tablette]
}
]
)
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
Dictionary type. One of:
stopword, plural, compound.The dictionary entries to add.
Show child attributes
Show child attributes
Unique ID of the dictionary entry.
Language ISO code supported by this dictionary,
for example
en for English.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.Whether this dictionary entry is active:
enabled: this dictionary entry is activedisabled: this dictionary entry is inactive
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
disabled.List of declensions for the
plurals dictionary.Additional parameters to add to this request.
Response
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 thegetLogs 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
}