Guides / Managing results / Optimize search results / Synonyms

Managing Synonyms from the Dashboard

Finding Synonyms in the dashboard

Select an index from the Indices section, click the Configuration tab, and choose Synonyms.

Synonyms 1

Adding synonyms

Add a new synonym by clicking Add Synonyms and choosing the type:

Regular synonyms

Synonyms 2

In the Synonyms field, enter your regular synonyms(/doc/guides/managing-results/optimize-search-results/adding-synonyms/#regular-synonyms-default): a comma-separated list of words or expressions that should be considered equivalent.

One-way synonyms

Synonyms 3

In the Search term field, enter your one-way synonym: the text used in a query that should be substituted by the comma-separated list of terms in the Alternatives field ( “tablet” for “ipad”, in the example).

Placeholders

Synonyms 5

In the Placeholder field, enter your placeholder synonym: the text, enclosed in angle brackets, used by any query matching one of the comma-separated list of expressions in the Replacements field (“<street>” for “street” and “st”, in the example).

Alternative corrections

Synonyms 4

In the Search term field, enter your alternative corrections synonym: the text used in the query that should be substituted by the comma-separated list of alternative words or expressions in the Corrections field. “tablet” for “ipad”, in the example).

In the Typo field, choose the number of typos allowed (1 or 2) when the search term matches one of the corrections.

What does “Copy this expansion to other indices and/or replicas” mean?

You can automatically copy any synonym that you create to other indices. Check the Copy this expansion to other indices and/or replicas option and choose your indices if you want this to happen.

Importing synonyms from a file

If you have many synonyms, perhaps sourced by a merchandising team or pulled from an external dictionary, adding them one by one would be time-consuming. A more straightforward method is to upload an entire file of synonyms at once. To do this, click on the arrow next to Add Synonyms and then click Upload.

Synonyms 6

JSON and CSV are the two supported data formats, but CSV is limited to regular synonyms (see below).

JSON

The file must contain an array of newline-delimited JSON objects. Each object must include:

  • A unique objectID value that identifies the synonym record. objectID isn’t automatically generated if it’s missing.
  • A type value. Options are synonym, oneWaySynonym, altCorrection1, altCorrection2, and placeholder.
  • All other fields required by the chosen type.

CSV

You can only use CSV files to import regular synonyms (type is synonym). The file must contain one set of comma-separated synonyms per line.

CSV import only supports Unix line breaks (\r\n), not CR/LF.

Copy to replicas

Check the Copy these synonyms to other indices and/or replicas box to copy synonyms to replicas of this index.

You can also batch import and export synonyms as part of a configuration file.

Exporting synonyms to a file

To back up or take a snapshot of your synonyms, click on the arrow next to Add Synonyms and click Export as JSON or *Export as CSV.

CSV is limited to regular synonyms.

Deleting synonyms

You can delete individual synonyms or all the synonyms in an index.

Delete one synonym

To delete a specific synonym, click the Trash can icon in the synonyms list.

Synonyms 8

Delete all synonyms

To remove all synonyms from an index, click on the arrow next to Add Synonyms and then click Delete All:

Synonyms 7

This operation can’t be undone.

Confirm the deletion by entering the name of the index.

Check Delete all these expansions on other indices and/or replicas to propagate the deletion to all replicas and chosen indices.

Editing synonyms

Click the edit button (pencil icon) to edit synonyms. This re-opens the synonym creation window.

Synonyms 9

Searching for synonyms

The dashboard allows you to search through synonyms and also filter by type.

Synonyms search

Did you find this page helpful?