# Synonyms

Child route of the settings route.

Synonyms is an object containing words and their respective synonyms. A synonym in Meilisearch is considered equal to its associated word in a search query.

Synonyms can also be updated directly through the global settings route along with the other settings.

To learn more about synonyms, refer to our dedicated guide.

WARNING

Updating the settings means overwriting the default settings of Meilisearch. You can reset to default values using the DELETE routes.

# Get synonyms

GET
/indexes/{index_uid}/settings/synonyms

Get the list of synonyms of an index. The index uid is required.

# Example

curl \
  -X GET 'http://localhost:7700/indexes/movies/settings/synonyms'

# Response: 200 OK

{
  "wolverine": [
    "xmen",
    "logan"
  ],
  "logan": [
    "wolverine",
    "xmen"
  ],
  "wow": [
    "world of warcraft"
  ]
}

# Update synonyms

POST
/indexes/{index_uid}/settings/synonyms

Update the list of synonyms of an index. Synonyms are normalized. The index uid is required.

# Body

An object that contains all synonyms and their associated words.

More information about the body.

# Example

curl \
  -X POST 'http://localhost:7700/indexes/movies/settings/synonyms' \
  -H 'Content-Type: application/json' \
  --data-binary '{
    "wolverine": [
      "xmen",
      "logan"
    ],
    "logan": [
      "wolverine",
      "xmen"
    ],
    "wow": ["world of warcraft"]
  }'

# Response: 202 Accepted

{
    "uid": 1,
    "indexUid": "movies",
    "status": "enqueued",
    "type": "settingsUpdate",
    "enqueuedAt": "2021-08-11T09:25:53.000000Z"
}

You can use this uid to get more details on the status of the task.

# Reset synonyms

DELETE
/indexes/{index_uid}/settings/synonyms

Reset the list of synonyms of an index to its default value. The index uid is required.

# Default value

Empty object : {}

# Example

curl \
  -X DELETE 'http://localhost:7700/indexes/movies/settings/synonyms'

# Response: 202 Accepted

{
    "uid": 1,
    "indexUid": "movies",
    "status": "enqueued",
    "type": "settingsUpdate",
    "enqueuedAt": "2021-08-11T09:25:53.000000Z"
}

You can use this uid to get more details on the status of the task.