Module: ElasticsearchServerless::API::Actions
- Included in:
- ElasticsearchServerless::API
- Defined in:
- lib/elasticsearch-serverless/api/get.rb,
lib/elasticsearch-serverless/api/bulk.rb,
lib/elasticsearch-serverless/api/info.rb,
lib/elasticsearch-serverless/api/mget.rb,
lib/elasticsearch-serverless/api/ping.rb,
lib/elasticsearch-serverless/api/count.rb,
lib/elasticsearch-serverless/api/index.rb,
lib/elasticsearch-serverless/api/create.rb,
lib/elasticsearch-serverless/api/delete.rb,
lib/elasticsearch-serverless/api/exists.rb,
lib/elasticsearch-serverless/api/scroll.rb,
lib/elasticsearch-serverless/api/search.rb,
lib/elasticsearch-serverless/api/update.rb,
lib/elasticsearch-serverless/api/explain.rb,
lib/elasticsearch-serverless/api/msearch.rb,
lib/elasticsearch-serverless/api/reindex.rb,
lib/elasticsearch-serverless/api/rank_eval.rb,
lib/elasticsearch-serverless/api/field_caps.rb,
lib/elasticsearch-serverless/api/get_script.rb,
lib/elasticsearch-serverless/api/get_source.rb,
lib/elasticsearch-serverless/api/put_script.rb,
lib/elasticsearch-serverless/api/search_mvt.rb,
lib/elasticsearch-serverless/api/terms_enum.rb,
lib/elasticsearch-serverless/api/termvectors.rb,
lib/elasticsearch-serverless/api/clear_scroll.rb,
lib/elasticsearch-serverless/api/mtermvectors.rb,
lib/elasticsearch-serverless/api/delete_script.rb,
lib/elasticsearch-serverless/api/exists_source.rb,
lib/elasticsearch-serverless/api/delete_by_query.rb,
lib/elasticsearch-serverless/api/search_template.rb,
lib/elasticsearch-serverless/api/update_by_query.rb,
lib/elasticsearch-serverless/api/msearch_template.rb,
lib/elasticsearch-serverless/api/open_point_in_time.rb,
lib/elasticsearch-serverless/api/close_point_in_time.rb,
lib/elasticsearch-serverless/api/render_search_template.rb,
lib/elasticsearch-serverless/api/scripts_painless_execute.rb
Instance Method Summary collapse
-
#bulk(arguments = {}) ⇒ Object
Bulk index or delete documents.
-
#clear_scroll(arguments = {}) ⇒ Object
Clear a scrolling search.
-
#close_point_in_time(arguments = {}) ⇒ Object
Close a point in time.
-
#count(arguments = {}) ⇒ Object
Returns number of documents matching a query.
-
#create(arguments = {}) ⇒ Object
Index a document.
-
#delete(arguments = {}) ⇒ Object
Delete a document.
-
#delete_by_query(arguments = {}) ⇒ Object
Delete documents.
-
#delete_script(arguments = {}) ⇒ Object
Delete a script or search template.
-
#exists(arguments = {}) ⇒ Object
(also: #exists?)
Check a document.
-
#exists_source(arguments = {}) ⇒ Object
(also: #exists_source?)
Check for a document source.
-
#explain(arguments = {}) ⇒ Object
Explain a document match result.
-
#field_caps(arguments = {}) ⇒ Object
Get the field capabilities.
-
#get(arguments = {}) ⇒ Object
Get a document by its ID.
-
#get_script(arguments = {}) ⇒ Object
Get a script or search template.
-
#get_source(arguments = {}) ⇒ Object
Get a document’s source.
-
#index(arguments = {}) ⇒ Object
Index a document.
-
#info(arguments = {}) ⇒ Object
Get cluster info.
-
#mget(arguments = {}) ⇒ Object
Get multiple documents.
-
#msearch(arguments = {}) ⇒ Object
Run multiple searches.
-
#msearch_template(arguments = {}) ⇒ Object
Run multiple templated searches.
-
#mtermvectors(arguments = {}) ⇒ Object
Get multiple term vectors.
-
#open_point_in_time(arguments = {}) ⇒ Object
Open a point in time.
-
#ping(arguments = {}) ⇒ Object
Ping the cluster.
-
#put_script(arguments = {}) ⇒ Object
Create or update a script or search template.
-
#rank_eval(arguments = {}) ⇒ Object
Evaluate ranked search results.
-
#reindex(arguments = {}) ⇒ Object
Reindex documents.
-
#render_search_template(arguments = {}) ⇒ Object
Render a search template.
-
#scripts_painless_execute(arguments = {}) ⇒ Object
Run a script.
-
#scroll(arguments = {}) ⇒ Object
Run a scrolling search.
-
#search(arguments = {}) ⇒ Object
Run a search.
-
#search_mvt(arguments = {}) ⇒ Object
Search a vector tile.
-
#search_template(arguments = {}) ⇒ Object
Run a search with a search template.
-
#terms_enum(arguments = {}) ⇒ Object
Get terms in an index.
-
#termvector(arguments = {}) ⇒ Object
Deprecated: Use the plural version, #termvectors.
-
#termvectors(arguments = {}) ⇒ Object
Get term vector information.
-
#update(arguments = {}) ⇒ Object
Update a document.
-
#update_by_query(arguments = {}) ⇒ Object
Update documents.
Instance Method Details
#bulk(arguments = {}) ⇒ Object
Bulk index or delete documents. Performs multiple indexing or delete operations in a single API call. This reduces overhead and can greatly increase indexing speed.
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/elasticsearch-serverless/api/bulk.rb', line 47 def bulk(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "bulk" } defined_params = [:index].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _index = arguments.delete(:index) method = ElasticsearchServerless::API::HTTP_POST path = if _index "#{Utils.listify(_index)}/_bulk" else "_bulk" end params = Utils.process_params(arguments) if body.is_a? Array payload = ElasticsearchServerless::API::Utils.bulkify(body) else payload = body end headers.merge!("Content-Type" => "application/x-ndjson") ElasticsearchServerless::API::Response.new( perform_request(method, path, params, payload, headers, request_opts) ) end |
#clear_scroll(arguments = {}) ⇒ Object
Clear a scrolling search. Clear the search context and results for a scrolling search.
*Deprecation notice*: A scroll id can be quite large and should be specified as part of the body Deprecated since version 7.0.0
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/elasticsearch-serverless/api/clear_scroll.rb', line 39 def clear_scroll(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "clear_scroll" } arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _scroll_id = arguments.delete(:scroll_id) method = ElasticsearchServerless::API::HTTP_DELETE path = "_search/scroll" params = Utils.process_params(arguments) if Array(arguments[:ignore]).include?(404) Utils.rescue_from_not_found { ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) } else ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end end |
#close_point_in_time(arguments = {}) ⇒ Object
Close a point in time. A point in time must be opened explicitly before being used in search requests. The keep_alive
parameter tells Elasticsearch how long it should persist. A point in time is automatically closed when the keep_alive
period has elapsed. However, keeping points in time has a cost; close them as soon as they are no longer required for search requests.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/elasticsearch-serverless/api/close_point_in_time.rb', line 35 def close_point_in_time(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "close_point_in_time" } arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) method = ElasticsearchServerless::API::HTTP_DELETE path = "_pit" params = {} ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#count(arguments = {}) ⇒ Object
Returns number of documents matching a query.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/elasticsearch-serverless/api/count.rb', line 58 def count(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "count" } defined_params = [:index].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _index = arguments.delete(:index) method = if body ElasticsearchServerless::API::HTTP_POST else ElasticsearchServerless::API::HTTP_GET end path = if _index "#{Utils.listify(_index)}/_count" else "_count" end params = Utils.process_params(arguments) ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#create(arguments = {}) ⇒ Object
Index a document. Adds a JSON document to the specified data stream or index and makes it searchable. If the target is an index and the document already exists, the request updates the document and increments its version.
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/elasticsearch-serverless/api/create.rb', line 49 def create(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "create" } defined_params = [:index, :id].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? if arguments[:id] index arguments.update op_type: 'create' else index arguments end end |
#delete(arguments = {}) ⇒ Object
Delete a document. Removes a JSON document from the specified index.
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/elasticsearch-serverless/api/delete.rb', line 44 def delete(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "delete" } defined_params = [:index, :id].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _id = arguments.delete(:id) _index = arguments.delete(:index) method = ElasticsearchServerless::API::HTTP_DELETE path = "#{Utils.listify(_index)}/_doc/#{Utils.listify(_id)}" params = Utils.process_params(arguments) if Array(arguments[:ignore]).include?(404) Utils.rescue_from_not_found { ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) } else ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end end |
#delete_by_query(arguments = {}) ⇒ Object
Delete documents. Deletes documents that match the specified query.
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/elasticsearch-serverless/api/delete_by_query.rb', line 80 def delete_by_query(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "delete_by_query" } defined_params = [:index].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _index = arguments.delete(:index) method = ElasticsearchServerless::API::HTTP_POST path = "#{Utils.listify(_index)}/_delete_by_query" params = Utils.process_params(arguments) ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#delete_script(arguments = {}) ⇒ Object
Delete a script or search template. Deletes a stored script or search template.
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/elasticsearch-serverless/api/delete_script.rb', line 36 def delete_script(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "delete_script" } defined_params = [:id].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _id = arguments.delete(:id) method = ElasticsearchServerless::API::HTTP_DELETE path = "_scripts/#{Utils.listify(_id)}" params = Utils.process_params(arguments) ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#exists(arguments = {}) ⇒ Object Also known as: exists?
Check a document. Checks if a specified document exists.
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/elasticsearch-serverless/api/exists.rb', line 48 def exists(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "exists" } defined_params = [:index, :id].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _id = arguments.delete(:id) _index = arguments.delete(:index) method = ElasticsearchServerless::API::HTTP_HEAD path = "#{Utils.listify(_index)}/_doc/#{Utils.listify(_id)}" params = Utils.process_params(arguments) Utils.rescue_from_not_found do perform_request(method, path, params, body, headers, request_opts).status == 200 ? true : false end end |
#exists_source(arguments = {}) ⇒ Object Also known as: exists_source?
Check for a document source. Checks if a document’s _source
is stored.
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/elasticsearch-serverless/api/exists_source.rb', line 45 def exists_source(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "exists_source" } defined_params = [:index, :id].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _id = arguments.delete(:id) _index = arguments.delete(:index) method = ElasticsearchServerless::API::HTTP_HEAD path = "#{Utils.listify(_index)}/_source/#{Utils.listify(_id)}" params = Utils.process_params(arguments) ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#explain(arguments = {}) ⇒ Object
Explain a document match result. Returns information about why a specific document matches, or doesn’t match, a query.
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/elasticsearch-serverless/api/explain.rb', line 49 def explain(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "explain" } defined_params = [:index, :id].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _id = arguments.delete(:id) _index = arguments.delete(:index) method = if body ElasticsearchServerless::API::HTTP_POST else ElasticsearchServerless::API::HTTP_GET end path = "#{Utils.listify(_index)}/_explain/#{Utils.listify(_id)}" params = Utils.process_params(arguments) ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#field_caps(arguments = {}) ⇒ Object
Get the field capabilities. Get information about the capabilities of fields among multiple indices. For data streams, the API returns field capabilities among the stream’s backing indices. It returns runtime fields like any other field. For example, a runtime field with a type of keyword is returned the same as any other field that belongs to the keyword
family.
46 47 48 49 50 51 52 53 54 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/elasticsearch-serverless/api/field_caps.rb', line 46 def field_caps(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "field_caps" } defined_params = [:index].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _index = arguments.delete(:index) method = if body ElasticsearchServerless::API::HTTP_POST else ElasticsearchServerless::API::HTTP_GET end path = if _index "#{Utils.listify(_index)}/_field_caps" else "_field_caps" end params = Utils.process_params(arguments) ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#get(arguments = {}) ⇒ Object
Get a document by its ID. Retrieves the document with the specified ID from an index.
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/elasticsearch-serverless/api/get.rb', line 48 def get(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "get" } defined_params = [:index, :id].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _id = arguments.delete(:id) _index = arguments.delete(:index) method = ElasticsearchServerless::API::HTTP_GET path = "#{Utils.listify(_index)}/_doc/#{Utils.listify(_id)}" params = Utils.process_params(arguments) if Array(arguments[:ignore]).include?(404) Utils.rescue_from_not_found { ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) } else ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end end |
#get_script(arguments = {}) ⇒ Object
Get a script or search template. Retrieves a stored script or search template.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/elasticsearch-serverless/api/get_script.rb', line 33 def get_script(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "get_script" } defined_params = [:id].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _id = arguments.delete(:id) method = ElasticsearchServerless::API::HTTP_GET path = "_scripts/#{Utils.listify(_id)}" params = Utils.process_params(arguments) ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#get_source(arguments = {}) ⇒ Object
Get a document’s source. Returns the source of a document.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/elasticsearch-serverless/api/get_source.rb', line 43 def get_source(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "get_source" } defined_params = [:index, :id].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _id = arguments.delete(:id) _index = arguments.delete(:index) method = ElasticsearchServerless::API::HTTP_GET path = "#{Utils.listify(_index)}/_source/#{Utils.listify(_id)}" params = Utils.process_params(arguments) ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#index(arguments = {}) ⇒ Object
Index a document. Adds a JSON document to the specified data stream or index and makes it searchable. If the target is an index and the document already exists, the request updates the document and increments its version.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/elasticsearch-serverless/api/index.rb', line 56 def index(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "index" } defined_params = [:index, :id].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _id = arguments.delete(:id) _index = arguments.delete(:index) method = _id ? ElasticsearchServerless::API::HTTP_PUT : ElasticsearchServerless::API::HTTP_POST path = if _index && _id "#{Utils.listify(_index)}/_doc/#{Utils.listify(_id)}" else "#{Utils.listify(_index)}/_doc" end params = Utils.process_params(arguments) ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#info(arguments = {}) ⇒ Object
Get cluster info. Returns basic information about the cluster.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/elasticsearch-serverless/api/info.rb', line 31 def info(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "info" } arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil method = ElasticsearchServerless::API::HTTP_GET path = "" params = {} ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#mget(arguments = {}) ⇒ Object
Get multiple documents. Get multiple JSON documents by ID from one or more indices. If you specify an index in the request URI, you only need to specify the document IDs in the request body. To ensure fast responses, this multi get (mget) API responds with partial results if one or more shards fail.
49 50 51 52 53 54 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/elasticsearch-serverless/api/mget.rb', line 49 def mget(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "mget" } defined_params = [:index].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _index = arguments.delete(:index) method = ElasticsearchServerless::API::HTTP_POST path = if _index "#{Utils.listify(_index)}/_mget" else "_mget" end params = Utils.process_params(arguments) ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#msearch(arguments = {}) ⇒ Object
Run multiple searches. The format of the request is similar to the bulk API format and makes use of the newline delimited JSON (NDJSON) format. The structure is as follows:
header
body
header
body
This structure is specifically optimized to reduce parsing if a specific search ends up redirected to another node. IMPORTANT: The final line of data must end with a newline character \n
. Each newline character may be preceded by a carriage return \r
. When sending requests to this endpoint the Content-Type
header should be set to application/x-ndjson
.
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/elasticsearch-serverless/api/msearch.rb', line 60 def msearch(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "msearch" } defined_params = [:index].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _index = arguments.delete(:index) method = ElasticsearchServerless::API::HTTP_POST path = if _index "#{Utils.listify(_index)}/_msearch" else "_msearch" end params = Utils.process_params(arguments) case when body.is_a?(Array) && body.any? { |d| d.has_key? :search } payload = body.inject([]) do |sum, item| = item data = .delete(:search) sum << sum << data sum end.map { |item| ElasticsearchServerless::API.serializer.dump(item) } payload << "" unless payload.empty? payload = payload.join("\n") when body.is_a?(Array) payload = body.map { |d| d.is_a?(String) ? d : ElasticsearchServerless::API.serializer.dump(d) } payload << "" unless payload.empty? payload = payload.join("\n") else payload = body end headers.merge!("Content-Type" => "application/x-ndjson") ElasticsearchServerless::API::Response.new( perform_request(method, path, params, payload, headers, request_opts) ) end |
#msearch_template(arguments = {}) ⇒ Object
Run multiple templated searches.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/elasticsearch-serverless/api/msearch_template.rb', line 41 def msearch_template(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "msearch_template" } defined_params = [:index].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _index = arguments.delete(:index) method = ElasticsearchServerless::API::HTTP_POST path = if _index "#{Utils.listify(_index)}/_msearch/template" else "_msearch/template" end params = Utils.process_params(arguments) case when body.is_a?(Array) payload = body.map { |d| d.is_a?(String) ? d : ElasticsearchServerless::API.serializer.dump(d) } payload << "" unless payload.empty? payload = payload.join(" ") else payload = body end headers.merge!("Content-Type" => "application/x-ndjson") ElasticsearchServerless::API::Response.new( perform_request(method, path, params, payload, headers, request_opts) ) end |
#mtermvectors(arguments = {}) ⇒ Object
Get multiple term vectors. You can specify existing documents by index and ID or provide artificial documents in the body of the request. You can specify the index in the request body or request URI. The response contains a docs
array with all the fetched termvectors. Each element has the structure provided by the termvectors API.
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/elasticsearch-serverless/api/mtermvectors.rb', line 50 def mtermvectors(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "mtermvectors" } defined_params = [:index].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _index = arguments.delete(:index) method = if body ElasticsearchServerless::API::HTTP_POST else ElasticsearchServerless::API::HTTP_GET end path = if _index "#{Utils.listify(_index)}/_mtermvectors" else "_mtermvectors" end params = Utils.process_params(arguments) ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#open_point_in_time(arguments = {}) ⇒ Object
Open a point in time. A search request by default runs against the most recent visible data of the target indices, which is called point in time. Elasticsearch pit (point in time) is a lightweight view into the state of the data as it existed when initiated. In some cases, it’s preferred to perform multiple search requests using the same point in time. For example, if refreshes happen between search_after
requests, then the results of those requests might not be consistent as changes happening between searches are only visible to the more recent point in time. A point in time must be opened explicitly before being used in search requests. The keep_alive
parameter tells Elasticsearch how long it should persist.
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/elasticsearch-serverless/api/open_point_in_time.rb', line 50 def open_point_in_time(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "open_point_in_time" } defined_params = [:index].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _index = arguments.delete(:index) method = ElasticsearchServerless::API::HTTP_POST path = "#{Utils.listify(_index)}/_pit" params = Utils.process_params(arguments) ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#ping(arguments = {}) ⇒ Object
Ping the cluster. Returns whether the cluster is running.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/elasticsearch-serverless/api/ping.rb', line 31 def ping(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "ping" } arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil method = ElasticsearchServerless::API::HTTP_HEAD path = "" params = {} begin perform_request(method, path, params, body, headers, request_opts).status == 200 ? true : false rescue Exception => e if e.class.to_s =~ /NotFound|ConnectionFailed/ || e. =~ /Not *Found|404|ConnectionFailed/i false else raise e end end end |
#put_script(arguments = {}) ⇒ Object
Create or update a script or search template. Creates or updates a stored script or search template.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/elasticsearch-serverless/api/put_script.rb', line 40 def put_script(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "put_script" } defined_params = [:id, :context].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _id = arguments.delete(:id) _context = arguments.delete(:context) method = ElasticsearchServerless::API::HTTP_PUT path = if _id && _context "_scripts/#{Utils.listify(_id)}/#{Utils.listify(_context)}" else "_scripts/#{Utils.listify(_id)}" end params = Utils.process_params(arguments) ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#rank_eval(arguments = {}) ⇒ Object
Evaluate ranked search results. Evaluate the quality of ranked search results over a set of typical search queries.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/elasticsearch-serverless/api/rank_eval.rb', line 38 def rank_eval(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "rank_eval" } defined_params = [:index].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _index = arguments.delete(:index) method = ElasticsearchServerless::API::HTTP_POST path = if _index "#{Utils.listify(_index)}/_rank_eval" else "_rank_eval" end params = Utils.process_params(arguments) ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#reindex(arguments = {}) ⇒ Object
Reindex documents. Copies documents from a source to a destination. The source can be any existing index, alias, or data stream. The destination must differ from the source. For example, you cannot reindex a data stream into itself.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/elasticsearch-serverless/api/reindex.rb', line 43 def reindex(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "reindex" } raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) method = ElasticsearchServerless::API::HTTP_POST path = "_reindex" params = Utils.process_params(arguments) ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#render_search_template(arguments = {}) ⇒ Object
Render a search template. Render a search template as a search request body.
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/elasticsearch-serverless/api/render_search_template.rb', line 34 def render_search_template(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "render_search_template" } defined_params = [:id].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _id = arguments.delete(:id) method = if body ElasticsearchServerless::API::HTTP_POST else ElasticsearchServerless::API::HTTP_GET end path = if _id "_render/template/#{Utils.listify(_id)}" else "_render/template" end params = {} ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#scripts_painless_execute(arguments = {}) ⇒ Object
Run a script. Runs a script and returns a result. 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.
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/elasticsearch-serverless/api/scripts_painless_execute.rb', line 36 def scripts_painless_execute(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "scripts_painless_execute" } arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) method = if body ElasticsearchServerless::API::HTTP_POST else ElasticsearchServerless::API::HTTP_GET end path = "_scripts/painless/_execute" params = {} ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#scroll(arguments = {}) ⇒ Object
Run a scrolling search. IMPORTANT: The scroll API is no longer recommend for deep pagination. If you need to preserve the index state while paging through more than 10,000 hits, use the search_after
parameter with a point in time (PIT). The scroll API gets large sets of results from a single scrolling search request. To get the necessary scroll ID, submit a search API request that includes an argument for the scroll
query parameter. The scroll
parameter indicates how long Elasticsearch should retain the search context for the request. The search response returns a scroll ID in the _scroll_id
response body parameter. You can then use the scroll ID with the scroll API to retrieve the next batch of results for the request. If the Elasticsearch security features are enabled, the access to the results of a specific scroll ID is restricted to the user or API key that submitted the search. You can also use the scroll API to specify a new scroll parameter that extends or shortens the retention period for the search context. IMPORTANT: Results from a scrolling search reflect the state of the index at the time of the initial search request. Subsequent indexing or document changes only affect later search and scroll requests.
*Deprecation notice*: A scroll id can be quite large and should be specified as part of the body Deprecated since version 7.0.0
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/elasticsearch-serverless/api/scroll.rb', line 48 def scroll(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "scroll" } arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _scroll_id = arguments.delete(:scroll_id) method = if body ElasticsearchServerless::API::HTTP_POST else ElasticsearchServerless::API::HTTP_GET end path = "_search/scroll" params = Utils.process_params(arguments) ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#search(arguments = {}) ⇒ Object
Run a search. Get search hits that match the query defined in the request. You can provide search queries using the q
query string parameter or the request body. If both are specified, only the query parameter is used.
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 |
# File 'lib/elasticsearch-serverless/api/search.rb', line 146 def search(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "search" } defined_params = [:index].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _index = arguments.delete(:index) method = if body ElasticsearchServerless::API::HTTP_POST else ElasticsearchServerless::API::HTTP_GET end path = if _index "#{Utils.listify(_index)}/_search" else "_search" end params = Utils.process_params(arguments) ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#search_mvt(arguments = {}) ⇒ Object
Search a vector tile. Search a vector tile for geospatial values.
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/elasticsearch-serverless/api/search_mvt.rb', line 55 def search_mvt(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "search_mvt" } defined_params = [:index, :field, :zoom, :x, :y].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] raise ArgumentError, "Required argument 'field' missing" unless arguments[:field] raise ArgumentError, "Required argument 'zoom' missing" unless arguments[:zoom] raise ArgumentError, "Required argument 'x' missing" unless arguments[:x] raise ArgumentError, "Required argument 'y' missing" unless arguments[:y] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _index = arguments.delete(:index) _field = arguments.delete(:field) _zoom = arguments.delete(:zoom) _x = arguments.delete(:x) _y = arguments.delete(:y) method = ElasticsearchServerless::API::HTTP_POST path = "#{Utils.listify(_index)}/_mvt/#{Utils.listify(_field)}/#{Utils.listify(_zoom)}/#{Utils.listify(_x)}/#{Utils.listify(_y)}" params = Utils.process_params(arguments) ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#search_template(arguments = {}) ⇒ Object
Run a search with a search template.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/elasticsearch-serverless/api/search_template.rb', line 53 def search_template(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "search_template" } defined_params = [:index].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _index = arguments.delete(:index) method = ElasticsearchServerless::API::HTTP_POST path = if _index "#{Utils.listify(_index)}/_search/template" else "_search/template" end params = Utils.process_params(arguments) ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#terms_enum(arguments = {}) ⇒ Object
Get terms in an index. Discover terms that match a partial string in an index. This “terms enum” API is designed for low-latency look-ups used in auto-complete scenarios. If the complete
property in the response is false, the returned terms set may be incomplete and should be treated as approximate. This can occur due to a few reasons, such as a request timeout or a node error. NOTE: The terms enum API may return terms from deleted documents. Deleted documents are initially only marked as deleted. It is not until their segments are merged that documents are actually deleted. Until that happens, the terms enum API will return terms from these documents.
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/elasticsearch-serverless/api/terms_enum.rb', line 37 def terms_enum(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "terms_enum" } defined_params = [:index].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _index = arguments.delete(:index) method = if body ElasticsearchServerless::API::HTTP_POST else ElasticsearchServerless::API::HTTP_GET end path = "#{Utils.listify(_index)}/_terms_enum" params = {} ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#termvector(arguments = {}) ⇒ Object
Deprecated: Use the plural version, #termvectors
88 89 90 91 |
# File 'lib/elasticsearch-serverless/api/termvectors.rb', line 88 def termvector(arguments = {}) warn "[DEPRECATION] `termvector` is deprecated. Please use the plural version, `termvectors` instead." termvectors(arguments.merge endpoint: '_termvector') end |
#termvectors(arguments = {}) ⇒ Object
Get term vector information. Get information and statistics about terms in the fields of a particular document.
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/elasticsearch-serverless/api/termvectors.rb', line 47 def termvectors(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "termvectors" } defined_params = [:index, :id].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _index = arguments.delete(:index) _id = arguments.delete(:id) method = if body ElasticsearchServerless::API::HTTP_POST else ElasticsearchServerless::API::HTTP_GET end arguments.delete(:endpoint) path = if _index && _id "#{Utils.listify(_index)}/_termvectors/#{Utils.listify(_id)}" else "#{Utils.listify(_index)}/_termvectors" end params = Utils.process_params(arguments) ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#update(arguments = {}) ⇒ Object
Update a document. Updates a document by running a script or passing a partial document.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/elasticsearch-serverless/api/update.rb', line 53 def update(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "update" } defined_params = [:index, :id].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? 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] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _id = arguments.delete(:id) _index = arguments.delete(:index) method = ElasticsearchServerless::API::HTTP_POST path = "#{Utils.listify(_index)}/_update/#{Utils.listify(_id)}" params = Utils.process_params(arguments) if Array(arguments[:ignore]).include?(404) Utils.rescue_from_not_found { ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) } else ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end end |
#update_by_query(arguments = {}) ⇒ Object
Update documents. Updates documents that match the specified query. If no query is specified, performs an update on every document in the data stream or index without modifying the source, which is useful for picking up mapping changes.
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/elasticsearch-serverless/api/update_by_query.rb', line 83 def update_by_query(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "update_by_query" } defined_params = [:index].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _index = arguments.delete(:index) method = ElasticsearchServerless::API::HTTP_POST path = "#{Utils.listify(_index)}/_update_by_query" params = Utils.process_params(arguments) ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |