List synonyms sets
Retrieves a summary of all defined synonyms sets.
This API allows to retrieve the total number of synonyms sets defined. For each synonyms set, its identifier and the total number of defined synonym rules is returned.
Request
GET _synonyms
Prerequisites
Requires the manage_search_synonyms cluster privilege.
Query parameters
-
from - (Optional, integer) Starting offset for synonyms sets to retrieve. Defaults to
0. -
size - (Optional, integer) Specifies the maximum number of synonyms sets to retrieve. Defaults to
10.
Examples
The following example retrieves all defined synonyms sets:
resp = client.synonyms.get_synonyms_sets() print(resp)
response = client.synonyms.get_synonyms_sets puts response
const response = await client.synonyms.getSynonymsSets(); console.log(response);
GET _synonyms
A sample response:
{
"count": 3,
"results": [
{
"synonyms_set": "ecommerce-synonyms",
"count": 2
},
{
"synonyms_set": "my-synonyms-set",
"count": 3
},
{
"synonyms_set": "new-ecommerce-synonyms",
"count": 1
}
]
}
© 2023-2025 Elasticsearch
As of September 2024, Elasticsearch is available under a choice of three licenses: the Server Side Public License (SSPL), the Elastic License, or the AGPLv3 (OSI approved).
Elasticsearch and the Elasticsearch logo are trademarks of Elasticsearch B.V., registered in the U.S. and in other countries.
https://www.elastic.co/guide/en/elasticsearch/reference/8.17/list-synonyms-sets.html