---
title: Synonyms
slug: cms-12/docs/synonyms
docTags: 
createdAt: 2026-08-10T15:56:01.000Z
---

Use synonyms to improve search results by adding uni- or bi-directional relationships between phrases.

:::hint{type="info"}
**Note**
To learn how to add synonyms through the administrative interface, see [Add synonyms for similar phrases](docId\:q8l4QvPHrwLfBMqXib_Qj).
:::

A synonym has an ID to use on update and removal. The ID is defined by

- the **phrase** *(a)*
- the **synonymous phrase** *(b)*
- whether relationship is **bidirectional**; meaning searches for *b* also return results for *a*
- **tags** for categorizing synonyms, for example, based on sites and languages

The synonyms client is made available through the `Synonyms` extension method on the Optimizely Search & Navigation client.

```csharp
using EPiServer.Find.Framework;
using EPiServer.Find.Optimizations;

var client = SearchClient.Instance;
```

## Enable synonyms in search results

To enable synonyms in search results, use the `UsingSynonyms` extension method for `IQueriedSearch` in `EPiServer.Find` namespace:

```csharp
var client = SearchClient.Instance;
var results = client.Search<FashionProduct>(Language.English)
    .For("puma")
    .InFields(x => x.Brand)
    .UsingSynonyms()
    .Take(100)
    .GetContentResult();
```

## Add method

In the following example, **bike** is the phrase, **bicycle** is the synonym, and **true** indicates that the relationship is bidirectional.

```csharp
var result = client.Optimizations().Synonyms().Add(new Synonym("bike", " bicycle ", true));
var synonymId = result.Id;
```

## Get method

To get a synonym, pass its ID to the `Get` method of the `Synonyms` client.

```csharp
var result = client.Optimizations().Synonyms().Get(synonymId);
```

## Delete method

To delete a synonym, pass its ID to the `Delete` method of the `Synonyms` client.

```csharp
var result = client.Optimizations().Synonyms().Delete(synonymId);
```

## List method

To retrieve synonyms, use the `List` method, which has `size` and `from` arguments to allow paging.

```csharp
var size = 10;
var from = 120;
var result = client.Optimizations().Synonyms().List(size, from);
```

Size indicates the number of synonyms to return per page. From indicates the synonym at which to start the list.

The default size value is 10, and the default from value is 0. If you run `client.Synonyms().List()` with no parameters, it returns the first ten synonyms.

**Examples**

- `client.Synonyms().List(5)` returns the first five synonyms.
- `client.Synonyms().List(5, 5)` returns the second page of the synonym list, five synonyms starting with the sixth result (it skips the first 5).
- `client.Synonyms().List(5, 10)` returns the third page of the synonym list: five synonyms starting from the eleventh result (it skips the first 10).

## CommandActions argument

The `Add`, `Get`, `Delete`, and `List` methods have overloads for passing a `commandAction`, which runs with the due `command` as an argument just before command execution.

```csharp
var result = client.Optimizations().Synonyms().Delete(synonymId, command  => _log.Debug(command.Id));
```
