Add or delete dictionary entries

Adds or deletes multiple entries from your plurals, segmentation, or stop word dictionaries.

Usage

Required ACL: editSettings
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
26
27
28
29
30
import 'package:algolia_client_search/algolia_client_search.dart';

final client =
    SearchClient(appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY');

final response = await client.batchDictionaryEntries(
  dictionaryName: DictionaryType.fromJson("plurals"),
  batchDictionaryEntriesParams: BatchDictionaryEntriesParams(
    clearExistingDictionaryEntries: true,
    requests: [
      BatchDictionaryEntriesRequest(
        action: DictionaryAction.fromJson("addEntry"),
        body: DictionaryEntry(
          objectID: "1",
          language: SupportedLanguage.fromJson("en"),
          word: "fancy",
          words: [
            "believe",
            "algolia",
          ],
          decomposition: [
            "trust",
            "algolia",
          ],
          state: DictionaryEntryState.fromJson("enabled"),
        ),
      ),
    ],
  ),
);
Did you find this page helpful?