Method: Elasticsearch::API::Synonyms::Actions#put

Defined in:
lib/elasticsearch/api/actions/synonyms/put.rb

#put(arguments = {}) ⇒ Object

Creates or updates a synonyms set This functionality is Experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features.

Options Hash (arguments):

  • :synonyms_set (String)

    The name of the synonyms set to be created or updated

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    Synonyms set rules (Required)

Raises:

  • (ArgumentError)

See Also:



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/elasticsearch/api/actions/synonyms/put.rb', line 37

def put(arguments = {})
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'synonyms_set' missing" unless arguments[:synonyms_set]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = arguments.delete(:body)

  _synonyms_set = arguments.delete(:synonyms_set)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_synonyms/#{Utils.__listify(_synonyms_set)}"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers)
  )
end