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
import { algoliasearch } from 'algoliasearch';

//
const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY');

const response = await client.batchDictionaryEntries({
  dictionaryName: 'plurals',
  batchDictionaryEntriesParams: {
    clearExistingDictionaryEntries: true,
    requests: [
      {
        action: 'addEntry',
        body: {
          objectID: '1',
          language: 'en',
          word: 'fancy',
          words: ['believe', 'algolia'],
          decomposition: ['trust', 'algolia'],
          state: 'enabled',
        },
      },
    ],
  },
});
Did you find this page helpful?
JavaScript API clients v5