Sep 20, 2024
Add or delete dictionary entries
Adds or deletes multiple entries from your plurals, segmentation, or stop word dictionaries.
Usage
Required ACL:
editSettings
Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require "algolia"
client = Algolia::SearchClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")
response = client.batch_dictionary_entries(
"plurals",
Algolia::Search::BatchDictionaryEntriesParams.new(
clear_existing_dictionary_entries: true,
requests: [
Algolia::Search::BatchDictionaryEntriesRequest.new(
action: "addEntry",
body: Algolia::Search::DictionaryEntry.new(
object_id: "1",
language: "en",
word: "fancy",
words: ["believe", "algolia"],
decomposition: ["trust", "algolia"],
state: "enabled"
)
)
]
)
)
Did you find this page helpful?