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
24
25
import com.algolia.api.SearchClient;
import com.algolia.model.search.*;
SearchClient client = new SearchClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY");
client.batchDictionaryEntries(
DictionaryType.PLURALS,
new BatchDictionaryEntriesParams()
.setClearExistingDictionaryEntries(true)
.setRequests(
Arrays.asList(
new BatchDictionaryEntriesRequest()
.setAction(DictionaryAction.ADD_ENTRY)
.setBody(
new DictionaryEntry()
.setObjectID("1")
.setLanguage(SupportedLanguage.EN)
.setWord("fancy")
.setWords(Arrays.asList("believe", "algolia"))
.setDecomposition(Arrays.asList("trust", "algolia"))
.setState(DictionaryEntryState.ENABLED)
)
)
)
);
Did you find this page helpful?