Synonyms

class elasticsearch.client.SynonymsClient(client)
Parameters:

client (BaseClient) –

delete_synonym(*, id, error_trace=None, filter_path=None, human=None, pretty=None)

Deletes a synonym set

https://www.elastic.co/guide/en/elasticsearch/reference/8.13/delete-synonyms-set.html

Parameters:
  • id (str) – The id of the synonyms set to be deleted

  • error_trace (bool | None) –

  • filter_path (str | Sequence[str] | None) –

  • human (bool | None) –

  • pretty (bool | None) –

Return type:

ObjectApiResponse[Any]

delete_synonym_rule(*, set_id, rule_id, error_trace=None, filter_path=None, human=None, pretty=None)

Deletes a synonym rule in a synonym set

https://www.elastic.co/guide/en/elasticsearch/reference/8.13/delete-synonym-rule.html

Parameters:
  • set_id (str) – The id of the synonym set to be updated

  • rule_id (str) – The id of the synonym rule to be deleted

  • error_trace (bool | None) –

  • filter_path (str | Sequence[str] | None) –

  • human (bool | None) –

  • pretty (bool | None) –

Return type:

ObjectApiResponse[Any]

get_synonym(*, id, error_trace=None, filter_path=None, from_=None, human=None, pretty=None, size=None)

Retrieves a synonym set

https://www.elastic.co/guide/en/elasticsearch/reference/8.13/get-synonyms-set.html

Parameters:
  • id (str) – “The id of the synonyms set to be retrieved

  • from – Starting offset for query rules to be retrieved

  • size (int | None) – specifies a max number of query rules to retrieve

  • error_trace (bool | None) –

  • filter_path (str | Sequence[str] | None) –

  • from_ (int | None) –

  • human (bool | None) –

  • pretty (bool | None) –

Return type:

ObjectApiResponse[Any]

get_synonym_rule(*, set_id, rule_id, error_trace=None, filter_path=None, human=None, pretty=None)

Retrieves a synonym rule from a synonym set

https://www.elastic.co/guide/en/elasticsearch/reference/8.13/get-synonym-rule.html

Parameters:
  • set_id (str) – The id of the synonym set to retrieve the synonym rule from

  • rule_id (str) – The id of the synonym rule to retrieve

  • error_trace (bool | None) –

  • filter_path (str | Sequence[str] | None) –

  • human (bool | None) –

  • pretty (bool | None) –

Return type:

ObjectApiResponse[Any]

get_synonyms_sets(*, error_trace=None, filter_path=None, from_=None, human=None, pretty=None, size=None)

Retrieves a summary of all defined synonym sets

https://www.elastic.co/guide/en/elasticsearch/reference/8.13/list-synonyms-sets.html

Parameters:
  • from – Starting offset

  • size (int | None) – specifies a max number of results to get

  • error_trace (bool | None) –

  • filter_path (str | Sequence[str] | None) –

  • from_ (int | None) –

  • human (bool | None) –

  • pretty (bool | None) –

Return type:

ObjectApiResponse[Any]

put_synonym(*, id, synonyms_set=None, error_trace=None, filter_path=None, human=None, pretty=None, body=None)

Creates or updates a synonyms set

https://www.elastic.co/guide/en/elasticsearch/reference/8.13/put-synonyms-set.html

Parameters:
  • id (str) – The id of the synonyms set to be created or updated

  • synonyms_set (Sequence[Mapping[str, Any]] | None) – The synonym set information to update

  • error_trace (bool | None) –

  • filter_path (str | Sequence[str] | None) –

  • human (bool | None) –

  • pretty (bool | None) –

  • body (Dict[str, Any] | None) –

Return type:

ObjectApiResponse[Any]

put_synonym_rule(*, set_id, rule_id, synonyms=None, error_trace=None, filter_path=None, human=None, pretty=None, body=None)

Creates or updates a synonym rule in a synonym set

https://www.elastic.co/guide/en/elasticsearch/reference/8.13/put-synonym-rule.html

Parameters:
  • set_id (str) – The id of the synonym set to be updated with the synonym rule

  • rule_id (str) – The id of the synonym rule to be updated or created

  • synonyms (str | None) –

  • error_trace (bool | None) –

  • filter_path (str | Sequence[str] | None) –

  • human (bool | None) –

  • pretty (bool | None) –

  • body (Dict[str, Any] | None) –

Return type:

ObjectApiResponse[Any]