editSettings
Examples
Save stopword entries
Stopword stopword = new Stopword()
{
ObjectID = objectId,
Language = "en",
Word = "upper",
State = "enabled"
};
// Synchronous
var saveDictionaryResponse = DictionaryClient.SaveDictionaryEntries(algoliaDictionary, new List<DictionaryEntry>() { stopword });
// Asynchronous
var saveDictionaryResponse = DictionaryClient.SaveDictionaryEntriesAsync(algoliaDictionary, new List<DictionaryEntry>() { stopword });
saveDictionaryResponse.Wait();
stopwordEntry := search.NewStopword(entryID, "en", "down", "enabled")
res, err := client.SaveDictionaryEntries(search.Stopwords, []search.DictionaryEntry{stopwordEntry})
Stopword stopword = DictionaryEntry.stopword("MyObjectID", "en", "upper", "enabled");
// Synchronous
client.saveDictionaryEntries(Dictionary.STOPWORDS, Collections.singletonList(stopword));
// Asynchronous
client.saveDictionaryEntriesAsync(Dictionary.STOPWORDS, Collections.singletonList(stopword));
client.saveDictionaryEntries("stopwords", [
{
objectID: "down",
language: "en",
word: "down",
},
]);
val entry = DictionaryEntry.Stopword(
objectID = ObjectID("MyObjectID"),
language = Language.English,
word = "upper"
)
client.saveDictionaryEntries(Dictionary.Stopwords, listOf(entry))
// or using extension function:
client.saveStopwordEntries(listOf(entry))
$client->saveDictionaryEntries(
'stopwords',
array(array(
'objectID' => 'down',
'language' => 'en',
'word' => 'down'
))
);
client.save_dictionary_entries(
"stopwords", [{"objectID": "down", "language": "en", "word": "down"}]
)
client.save_dictionary_entries(
"stopwords",
[
{
objectID: "down",
language: "en",
word: "down"
}
]
)
val entry = StopwordEntry(
objectID = "MyObjectID",
language = "en",
word = "upper",
state = "enabled"
)
client.execute {
save dictionary Stopwords entries Seq(entry)
}
let entry = StopwordsDictionary.Entry(objectID: "down",
language: .english,
word: "down",
state: .enabled)
client.saveDictionaryEntries(to: StopwordsDictionary.self, dictionaryEntries: [entry]) { result in
if case .success(let response) = result {
print("Response: \(response)")
}
}
Save plural entries
Plural plural = new Plural()
{
ObjectID = objectId,
Language = "fr",
Words = new List<String>() { "cheval", "chevaux" }
};
// Synchronous
DictionaryClient.SaveDictionaryEntries(algoliaDictionary, new List<DictionaryEntry>() { plural });
// Asynchronous
var saveDictionaryResponse = await DictionaryClient.SaveDictionaryEntries(algoliaDictionary, new List<DictionaryEntry>() { plural });
saveDictionaryResponse.Wait();
pluralEntry := search.NewPlural(entryID, "fr", []string{"cheval", "chevaux"})
res, err := client.SaveDictionaryEntries(search.Plurals, []search.DictionaryEntry{pluralEntry})
Plural plural = DictionaryEntry.plural("MyObjectID", "fr", Arrays.asList("cheval", "chevaux"));
// Synchronous
client.saveDictionaryEntries(Dictionary.PLURALS, Collections.singletonList(plural));
// Asynchronous
client.saveDictionaryEntriesAsync(Dictionary.PLURALS, Collections.singletonList(plural));
client.saveDictionaryEntries("plurals", [
{
objectID: "chevaux",
language: "fr",
words: ["cheval", "chevaux"],
},
]);
val entry = DictionaryEntry.Plural(
objectID = ObjectID("MyObjectID"),
language = Language.French,
words = listOf("cheval", "chevaux")
)
client.saveDictionaryEntries(Dictionary.Plurals, listOf(entry))
// or using extension function:
client.savePluralEntries(listOf(entry))
$client->saveDictionaryEntries(
'plurals',
array(array(
'objectID' => 'chevaux',
'language' => 'fr',
'words' => array('cheval', 'chevaux')
))
);
client.save_dictionary_entries(
"plurals",
[{"objectID": "chevaux", "language": "fr", "words": ["cheval", "chevaux"]}],
)
client.save_dictionary_entries(
"plurals",
[
{
objectID: "chevaux",
language: "fr",
words: %w[cheval chevaux]
}
]
)
val entry = PluralEntry(
objectID = "MyObjectID",
language = "fr",
words = Seq("cheval", "chevaux")
)
client.execute {
save dictionary Plurals entries Seq(entry)
}
let entry = PluralsDictionary.Entry(objectID: "chevaux",
language: .french,
words: ["cheval", "chevaux"])
client.saveDictionaryEntries(to: PluralsDictionary.self, dictionaryEntries: [entry]) { result in
if case .success(let response) = result {
print("Response: \(response)")
}
}
Save compound entries
Compound compound = new Compound()
{
ObjectID = objectId,
Language = "nl",
Word = "kopfschmerztablette",
Decomposition = new List<String>() { "kopf", "schmerz", "tablette" }
};
// Synchronous
DictionaryClient.SaveDictionaryEntries(algoliaDictionary, new List<DictionaryEntry>() { compound });
// Asynchronous
var saveDictionaryResponse = await DictionaryClient.SaveDictionaryEntriesAsync(algoliaDictionary, new List<DictionaryEntry>() { compound });
saveDictionaryResponse.Wait();
compoundEntry := search.NewCompound(entryID, "de", "kopfschmerztablette", []string{"kopf", "schmerz", "tablette"})
res, err := client.SaveDictionaryEntries(search.Compounds, []search.DictionaryEntry{compoundEntry})
Compound compound = DictionaryEntry.compound("MyObjectID", "de", "kopfschmerztablette", Arrays.asList("kopf", "schmerz", "tablette"));
// Synchronous
client.saveDictionaryEntries(Dictionary.COMPOUNDS, Collections.singletonList(compound));
// Asynchronous
client.saveDictionaryEntriesAsync(Dictionary.COMPOUNDS, Collections.singletonList(compound));
client.saveDictionaryEntries("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.saveDictionaryEntries(Dictionary.Compounds, listOf(entry))
// or using extension function:
client.saveCompoundEntries(listOf(entry))
$client->saveDictionaryEntries(
'compounds',
array(array(
'objectID' => 'kopfschmerztablette',
'language' => 'de',
'word' => 'kopfschmerztablette',
'decomposition' => array('kopf', 'schmerz', 'tablette')
))
);
client.save_dictionary_entries(
"compounds",
[
{
"objectID": "kopfschmerztablette",
"language": "de",
"word": "kopfschmerztablette",
"decomposition": ["kopf", "schmerz", "tablette"],
}
],
)
client.save_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 {
save dictionary Compounds entries Seq(entry)
}
let entry = CompoundsDictionary.Entry(objectID: "kopfschmerztablette",
language: .german,
word: "kopfschmerztablette",
decomposition: ["kopf", "schmerz", "tablette"])
client.saveDictionaryEntries(to: CompoundsDictionary.self, dictionaryEntries: [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
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 activedisabled: 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
disabled.string[]
List of declensions for the
plurals dictionary.object
Additional parameters to add to this request.
Response
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 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
}