List synonyms sets

List synonyms sets

New API reference

For the most up-to-date API details, refer to Synonyms APIs.

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:

  1. resp = client.synonyms.get_synonyms_sets()
  2. print(resp)
  1. response = client.synonyms.get_synonyms_sets
  2. puts response
  1. const response = await client.synonyms.getSynonymsSets();
  2. console.log(response);
  1. GET _synonyms

A sample response:

  1. {
  2. "count": 3,
  3. "results": [
  4. {
  5. "synonyms_set": "ecommerce-synonyms",
  6. "count": 2
  7. },
  8. {
  9. "synonyms_set": "my-synonyms-set",
  10. "count": 3
  11. },
  12. {
  13. "synonyms_set": "new-ecommerce-synonyms",
  14. "count": 1
  15. }
  16. ]
  17. }