View API Reference



API Method Description PHP Ruby JS Python iOS Android C# Java Go Scala name
Save synonym

Create or update a single synonym on an index.

saveSynonym save_synonym saveSynonym save_synonym - - saveSynonym saveSynonym AddSynonym save synonym
Batch synonyms

Create or update multiple synonyms.

batchSynonyms batch_synonyms batchSynonyms batch_synonyms - - batchSynonyms batchSynonyms BatchSynonyms save synonyms
Delete synonym

Remove a single synonym from an index using its object id.

deleteSynonym delete_synonym deleteSynonym delete_synonym - - DeleteSynonyms deleteSynonym DeleteSynonym delete synonym
Clear all synonyms

Remove all synonyms from an index.

clearSynonyms clear_synonyms clearSynonyms clear_synonyms - - clearSynonyms clearSynonyms ClearSynonyms clear synonyms of index
Get synonym

Get a single synonym using its object id.

getSynonym get_synonym getSynonym get_synonym - - getSynonym getSynonym GetSynonym get synonym
Search synonyms

Get all synonyms that match a query.

searchSynonyms search_synonyms searchSynonyms search_synonyms - - searchSynonyms searchSynonyms SearchSynonyms search synonyms of
Export Synonyms

Export all synonyms for a particular index using an iterator.

initSynonymBrowser export_synonyms exportSynonyms iter_synonyms - - SynonymsIterator SynonymsIterable NewSynonymIterator exportSynonyms

Algolia synonyms

A synonym record includes an objectID, the type of synonym, and a list of words as synonyms.

  objectID: 'a-unique-identifier',
  type: 'synonym',
  synonyms: ['car', 'vehicle', 'auto']

There are 4 types of synonym:

  • bi-directional, where the words are interchangeable
  • one-way, where a master word is used to find the other words, but not vice-versa
  • altcorrection1 or altcorrection2, where synonyms are used to resolve typos of 1 or 2 degrees
  • placeholder, where you define tokens (variables) that take any value from a list of defined words. See placeholders.

For more detail: