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
using Algolia.Search.Clients;
using Algolia.Search.Models.Search;

var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"));

var response = await client.BatchDictionaryEntriesAsync(
  Enum.Parse<DictionaryType>("Plurals"),
  new BatchDictionaryEntriesParams
  {
    ClearExistingDictionaryEntries = true,
    Requests = new List<BatchDictionaryEntriesRequest>
    {
      new BatchDictionaryEntriesRequest
      {
        Action = Enum.Parse<DictionaryAction>("AddEntry"),
        Body = new DictionaryEntry
        {
          ObjectID = "1",
          Language = Enum.Parse<SupportedLanguage>("En"),
          Word = "fancy",
          Words = new List<string> { "believe", "algolia" },
          Decomposition = new List<string> { "trust", "algolia" },
          State = Enum.Parse<DictionaryEntryState>("Enabled"),
        },
      },
    },
  }
);
Did you find this page helpful?
C# API clients v7