Method: OpenSearch::API::Actions#update
- Defined in:
- lib/opensearch/api/actions/update.rb
#update(arguments = {}) ⇒ Object
Updates a document with a script or partial document.
*Deprecation notice*: Specifying types in urls has been deprecated Deprecated since version 7.0.0
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/opensearch/api/actions/update.rb', line 55 def update(arguments = {}) raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] headers = arguments.delete(:headers) || {} arguments = arguments.clone _id = arguments.delete(:id) _index = arguments.delete(:index) method = OpenSearch::API::HTTP_POST path = "#{Utils.__listify(_index)}/_update/#{Utils.__listify(_id)}" params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = arguments[:body] if Array(arguments[:ignore]).include?(404) Utils.__rescue_from_not_found { perform_request(method, path, params, body, headers).body } else perform_request(method, path, params, body, headers).body end end |