elasticsearch-api 9.2.1 → 9.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/elasticsearch-api.gemspec +1 -0
  3. data/lib/elasticsearch/api/actions/async_search/submit.rb +1 -9
  4. data/lib/elasticsearch/api/actions/bulk.rb +1 -1
  5. data/lib/elasticsearch/api/actions/cat/circuit_breaker.rb +96 -0
  6. data/lib/elasticsearch/api/actions/cat/count.rb +8 -10
  7. data/lib/elasticsearch/api/actions/cat/indices.rb +0 -2
  8. data/lib/elasticsearch/api/actions/cluster/reroute.rb +1 -1
  9. data/lib/elasticsearch/api/actions/connector/sync_job_claim.rb +1 -0
  10. data/lib/elasticsearch/api/actions/connector/sync_job_error.rb +1 -0
  11. data/lib/elasticsearch/api/actions/connector/sync_job_update_stats.rb +1 -0
  12. data/lib/elasticsearch/api/actions/count.rb +1 -9
  13. data/lib/elasticsearch/api/actions/create.rb +1 -1
  14. data/lib/elasticsearch/api/actions/delete.rb +1 -1
  15. data/lib/elasticsearch/api/actions/delete_by_query.rb +1 -1
  16. data/lib/elasticsearch/api/actions/eql/search.rb +0 -8
  17. data/lib/elasticsearch/api/actions/esql/delete_view.rb +75 -0
  18. data/lib/elasticsearch/api/actions/esql/get_view.rb +77 -0
  19. data/lib/elasticsearch/api/actions/esql/put_view.rb +76 -0
  20. data/lib/elasticsearch/api/actions/exists.rb +1 -1
  21. data/lib/elasticsearch/api/actions/exists_source.rb +1 -1
  22. data/lib/elasticsearch/api/actions/explain.rb +1 -1
  23. data/lib/elasticsearch/api/actions/field_caps.rb +1 -9
  24. data/lib/elasticsearch/api/actions/fleet/search.rb +1 -1
  25. data/lib/elasticsearch/api/actions/get.rb +1 -1
  26. data/lib/elasticsearch/api/actions/get_source.rb +1 -1
  27. data/lib/elasticsearch/api/actions/graph/explore.rb +1 -1
  28. data/lib/elasticsearch/api/actions/index.rb +1 -1
  29. data/lib/elasticsearch/api/actions/indices/add_block.rb +1 -1
  30. data/lib/elasticsearch/api/actions/indices/data_streams_stats.rb +1 -1
  31. data/lib/elasticsearch/api/actions/indices/delete_sample_configuration.rb +80 -0
  32. data/lib/elasticsearch/api/actions/indices/downsample.rb +5 -2
  33. data/lib/elasticsearch/api/actions/indices/get_all_sample_configuration.rb +68 -0
  34. data/lib/elasticsearch/api/actions/indices/get_sample.rb +74 -0
  35. data/lib/elasticsearch/api/actions/indices/get_sample_configuration.rb +78 -0
  36. data/lib/elasticsearch/api/actions/indices/get_sample_stats.rb +74 -0
  37. data/lib/elasticsearch/api/actions/indices/put_sample_configuration.rb +82 -0
  38. data/lib/elasticsearch/api/actions/indices/remove_block.rb +1 -1
  39. data/lib/elasticsearch/api/actions/indices/resolve_index.rb +8 -10
  40. data/lib/elasticsearch/api/actions/indices/shrink.rb +0 -1
  41. data/lib/elasticsearch/api/actions/inference/get.rb +2 -5
  42. data/lib/elasticsearch/api/actions/inference/put.rb +6 -3
  43. data/lib/elasticsearch/api/actions/inference/put_alibabacloud.rb +1 -0
  44. data/lib/elasticsearch/api/actions/inference/put_amazonbedrock.rb +1 -0
  45. data/lib/elasticsearch/api/actions/inference/put_amazonsagemaker.rb +1 -0
  46. data/lib/elasticsearch/api/actions/inference/put_anthropic.rb +1 -0
  47. data/lib/elasticsearch/api/actions/inference/put_azureaistudio.rb +1 -0
  48. data/lib/elasticsearch/api/actions/inference/put_azureopenai.rb +1 -0
  49. data/lib/elasticsearch/api/actions/inference/put_cohere.rb +1 -0
  50. data/lib/elasticsearch/api/actions/inference/put_contextualai.rb +1 -0
  51. data/lib/elasticsearch/api/actions/inference/put_custom.rb +1 -0
  52. data/lib/elasticsearch/api/actions/inference/put_deepseek.rb +1 -0
  53. data/lib/elasticsearch/api/actions/inference/put_elasticsearch.rb +1 -0
  54. data/lib/elasticsearch/api/actions/inference/put_googleaistudio.rb +1 -0
  55. data/lib/elasticsearch/api/actions/inference/put_googlevertexai.rb +1 -0
  56. data/lib/elasticsearch/api/actions/inference/put_groq.rb +79 -0
  57. data/lib/elasticsearch/api/actions/inference/put_hugging_face.rb +1 -0
  58. data/lib/elasticsearch/api/actions/inference/put_jinaai.rb +1 -0
  59. data/lib/elasticsearch/api/actions/inference/put_mistral.rb +1 -0
  60. data/lib/elasticsearch/api/actions/inference/put_nvidia.rb +84 -0
  61. data/lib/elasticsearch/api/actions/inference/put_openai.rb +1 -0
  62. data/lib/elasticsearch/api/actions/inference/put_openshift_ai.rb +84 -0
  63. data/lib/elasticsearch/api/actions/inference/put_voyageai.rb +1 -0
  64. data/lib/elasticsearch/api/actions/inference/put_watsonx.rb +1 -0
  65. data/lib/elasticsearch/api/actions/inference/stream_completion.rb +1 -1
  66. data/lib/elasticsearch/api/actions/machine_learning/stop_datafeed.rb +1 -0
  67. data/lib/elasticsearch/api/actions/mget.rb +1 -1
  68. data/lib/elasticsearch/api/actions/migration/deprecations.rb +3 -6
  69. data/lib/elasticsearch/api/actions/msearch.rb +1 -1
  70. data/lib/elasticsearch/api/actions/mtermvectors.rb +1 -1
  71. data/lib/elasticsearch/api/actions/nodes/clear_repositories_metering_archive.rb +1 -0
  72. data/lib/elasticsearch/api/actions/nodes/usage.rb +1 -1
  73. data/lib/elasticsearch/api/actions/open_point_in_time.rb +1 -9
  74. data/lib/elasticsearch/api/actions/project/tags.rb +1 -2
  75. data/lib/elasticsearch/api/actions/reindex.rb +2 -1
  76. data/lib/elasticsearch/api/actions/search.rb +1 -9
  77. data/lib/elasticsearch/api/actions/search_shards.rb +1 -1
  78. data/lib/elasticsearch/api/actions/search_template.rb +2 -2
  79. data/lib/elasticsearch/api/actions/searchable_snapshots/cache_stats.rb +1 -0
  80. data/lib/elasticsearch/api/actions/security/clear_cached_privileges.rb +1 -1
  81. data/lib/elasticsearch/api/actions/snapshot/delete.rb +1 -1
  82. data/lib/elasticsearch/api/actions/snapshot/get.rb +1 -1
  83. data/lib/elasticsearch/api/actions/sql/query.rb +0 -8
  84. data/lib/elasticsearch/api/actions/streams/logs_disable.rb +0 -3
  85. data/lib/elasticsearch/api/actions/streams/logs_enable.rb +0 -3
  86. data/lib/elasticsearch/api/actions/streams/status.rb +0 -3
  87. data/lib/elasticsearch/api/actions/synonyms/put_synonym.rb +1 -0
  88. data/lib/elasticsearch/api/actions/terms_enum.rb +1 -1
  89. data/lib/elasticsearch/api/actions/termvectors.rb +1 -1
  90. data/lib/elasticsearch/api/actions/text_structure/find_field_structure.rb +1 -1
  91. data/lib/elasticsearch/api/actions/text_structure/find_message_structure.rb +1 -1
  92. data/lib/elasticsearch/api/actions/text_structure/find_structure.rb +1 -1
  93. data/lib/elasticsearch/api/actions/update.rb +1 -1
  94. data/lib/elasticsearch/api/actions/update_by_query.rb +2 -2
  95. data/lib/elasticsearch/api/utils.rb +0 -4
  96. data/lib/elasticsearch/api/version.rb +2 -2
  97. metadata +28 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6d8a67d5fa8414a8e09624ea2d41332567167610104a71e90d98ef526a9f5c43
4
- data.tar.gz: 8cf41f2ea31c275b6f53e3250a0b5cd4ebff0b35e28b205cdd5d31feb8c9744f
3
+ metadata.gz: 53c546506e26aa06e475332f9b71e3ff8b0bb863eab32ee56aad5c5795b59547
4
+ data.tar.gz: 40b27e5aa17848625953d5e6b2ca036828c66ce92992d5c7388cb5034240ff7f
5
5
  SHA512:
6
- metadata.gz: 17a9ce971775e193083d266768731a0ace9ebdc04656847dbf00d6c3f4d6ad0980619314dfd0cb3ecebb1a29ef6eebb3e744add150e88c3f92d714301fe5e805
7
- data.tar.gz: 6b5afa5dbf3deba0364541e23675682a0ffe6b22e07c7c3c7559926c7a2987b7fb724d15a8dbedccc5affe2d7fad6861ae5f3e6c13d062232ed9a437074b96e9
6
+ metadata.gz: f5494f5e8835f8e2094e6547a4ed5e69cfd77398fa1b8e87f81188dfbf688de7e2cfb08b89220c439de6ae667ce59c7bbf0eb5fe730f92115cb99fe58ad871d9
7
+ data.tar.gz: 02dbe09b72742453667e2d1e575a15f4738db89e387b25540e3a755a6c6f7d94635c8461f86e0cf0b3be39d0b8c0b3f0ae4d952a411dd183bab719f1547b531b
@@ -42,6 +42,7 @@ Gem::Specification.new do |s|
42
42
  s.rdoc_options = ['--charset=UTF-8']
43
43
 
44
44
  s.required_ruby_version = '>= 2.6' # For compatibility with JRuby 9.3
45
+ s.add_dependency 'base64'
45
46
  s.add_dependency 'multi_json'
46
47
 
47
48
  s.add_development_dependency 'ansi'
@@ -53,16 +53,8 @@ module Elasticsearch
53
53
  # @option arguments [Integer] :max_concurrent_shard_requests The number of concurrent shard requests per node this search executes concurrently.
54
54
  # This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests Server default: 5.
55
55
  # @option arguments [String] :preference Specify the node or shard the operation should be performed on Server default: random.
56
- # @option arguments [String] :project_routing Specifies a subset of projects to target for the search using project
57
- # metadata tags in a subset of Lucene query syntax.
58
- # Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded).
59
- # Examples:
60
- # _alias:my-project
61
- # _alias:_origin
62
- # _alias:*pr*
63
- # Supported in serverless only.
64
56
  # @option arguments [Boolean] :request_cache Specify if request cache should be used for this request or not, defaults to true Server default: true.
65
- # @option arguments [String] :routing A comma-separated list of specific routing values
57
+ # @option arguments [String, Array<String>] :routing A comma-separated list of specific routing values
66
58
  # @option arguments [String] :search_type Search operation type
67
59
  # @option arguments [Array<String>] :stats Specific 'tag' of the request for logging and statistical purposes
68
60
  # @option arguments [String, Array<String>] :stored_fields A comma-separated list of stored fields to return as part of a hit
@@ -124,7 +124,7 @@ module Elasticsearch
124
124
  # If `wait_for`, wait for a refresh to make this operation visible to search.
125
125
  # If `false`, do nothing with refreshes.
126
126
  # Valid values: `true`, `false`, `wait_for`. Server default: false.
127
- # @option arguments [String] :routing A custom value that is used to route operations to a specific shard.
127
+ # @option arguments [String, Array<String>] :routing A custom value that is used to route operations to a specific shard.
128
128
  # @option arguments [Boolean, String, Array<String>] :_source Indicates whether to return the `_source` field (`true` or `false`) or contains a list of fields to return.
129
129
  # @option arguments [String, Array<String>] :_source_excludes A comma-separated list of source fields to exclude from the response.
130
130
  # You can also use this parameter to exclude fields from the subset specified in `_source_includes` query parameter.
@@ -0,0 +1,96 @@
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+ #
18
+ # This code was automatically generated from the Elasticsearch Specification
19
+ # See https://github.com/elastic/elasticsearch-specification
20
+ # See Elasticsearch::ES_SPECIFICATION_COMMIT for commit hash.
21
+ module Elasticsearch
22
+ module API
23
+ module Cat
24
+ module Actions
25
+ # Get circuit breakers statistics.IMPORTANT: CAT APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications.
26
+ #
27
+ # @option arguments [String, Array<String>] :circuit_breaker_patterns A comma-separated list of regular-expressions to filter the circuit breakers in the output
28
+ # @option arguments [String, Array<String>] :h A comma-separated list of columns names to display. It supports simple wildcards.
29
+ # @option arguments [String, Array<String>] :s List of columns that determine how the table should be sorted.
30
+ # Sorting defaults to ascending and can be changed by setting `:asc`
31
+ # or `:desc` as a suffix to the column name.
32
+ # @option arguments [Boolean] :local If `true`, the request computes the list of selected nodes from the
33
+ # local cluster state. If `false` the list of selected nodes are computed
34
+ # from the cluster state of the master node. In both cases the coordinating
35
+ # node will send requests for further information to each selected node.
36
+ # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s.
37
+ # @option arguments [String] :format Specifies the format to return the columnar data in, can be set to
38
+ # `text`, `json`, `cbor`, `yaml`, or `smile`. Server default: text.
39
+ # @option arguments [Boolean] :help When set to `true` will output available columns. This option
40
+ # can't be combined with any other query string option.
41
+ # @option arguments [Boolean] :v When set to `true` will enable verbose output.
42
+ # @option arguments [String] :bytes Sets the units for columns that contain a byte-size value.
43
+ # Note that byte-size value units work in terms of powers of 1024. For instance `1kb` means 1024 bytes, not 1000 bytes.
44
+ # If omitted, byte-size values are rendered with a suffix such as `kb`, `mb`, or `gb`, chosen such that the numeric value of the column is as small as possible whilst still being at least `1.0`.
45
+ # If given, byte-size values are rendered as an integer with no suffix, representing the value of the column in the chosen unit.
46
+ # Values that are not an exact multiple of the chosen unit are rounded down.
47
+ # @option arguments [String] :time Sets the units for columns that contain a time duration.
48
+ # If omitted, time duration values are rendered with a suffix such as `ms`, `s`, `m` or `h`, chosen such that the numeric value of the column is as small as possible whilst still being at least `1.0`.
49
+ # If given, time duration values are rendered as an integer with no suffix.
50
+ # Values that are not an exact multiple of the chosen unit are rounded down.
51
+ # @option arguments [Boolean] :error_trace When set to `true` Elasticsearch will include the full stack trace of errors
52
+ # when they occur.
53
+ # @option arguments [String, Array<String>] :filter_path Comma-separated list of filters in dot notation which reduce the response
54
+ # returned by Elasticsearch.
55
+ # @option arguments [Boolean] :human When set to `true` will return statistics in a format suitable for humans.
56
+ # For example `"exists_time": "1h"` for humans and
57
+ # `"exists_time_in_millis": 3600000` for computers. When disabled the human
58
+ # readable values will be omitted. This makes sense for responses being consumed
59
+ # only by machines.
60
+ # @option arguments [Boolean] :pretty If set to `true` the returned JSON will be "pretty-formatted". Only use
61
+ # this option for debugging only.
62
+ # @option arguments [Hash] :headers Custom HTTP headers
63
+ #
64
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch#TODO
65
+ #
66
+ def circuit_breaker(arguments = {})
67
+ request_opts = { endpoint: arguments[:endpoint] || 'cat.circuit_breaker' }
68
+
69
+ defined_params = [:circuit_breaker_patterns].each_with_object({}) do |variable, set_variables|
70
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
71
+ end
72
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
73
+
74
+ arguments = arguments.clone
75
+ headers = arguments.delete(:headers) || {}
76
+
77
+ body = nil
78
+
79
+ _circuit_breaker_patterns = arguments.delete(:circuit_breaker_patterns)
80
+
81
+ method = Elasticsearch::API::HTTP_GET
82
+ path = if _circuit_breaker_patterns
83
+ "_cat/circuit_breaker/#{Utils.listify(_circuit_breaker_patterns)}"
84
+ else
85
+ '_cat/circuit_breaker'
86
+ end
87
+ params = Utils.process_params(arguments)
88
+
89
+ Elasticsearch::API::Response.new(
90
+ perform_request(method, path, params, body, headers, request_opts)
91
+ )
92
+ end
93
+ end
94
+ end
95
+ end
96
+ end
@@ -32,14 +32,6 @@ module Elasticsearch
32
32
  # It supports wildcards (`*`).
33
33
  # To target all data streams and indices, omit this parameter or use `*` or `_all`.
34
34
  # @option arguments [String, Array<String>] :h A comma-separated list of columns names to display. It supports simple wildcards.
35
- # @option arguments [String] :project_routing Specifies a subset of projects to target for the search using project
36
- # metadata tags in a subset of Lucene query syntax.
37
- # Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded).
38
- # Examples:
39
- # _alias:my-project
40
- # _alias:_origin
41
- # _alias:*pr*
42
- # Supported in serverless only.
43
35
  # @option arguments [String, Array<String>] :s List of columns that determine how the table should be sorted.
44
36
  # Sorting defaults to ascending and can be changed by setting `:asc`
45
37
  # or `:desc` as a suffix to the column name.
@@ -69,6 +61,7 @@ module Elasticsearch
69
61
  # @option arguments [Boolean] :pretty If set to `true` the returned JSON will be "pretty-formatted". Only use
70
62
  # this option for debugging only.
71
63
  # @option arguments [Hash] :headers Custom HTTP headers
64
+ # @option arguments [Hash] :body request body
72
65
  #
73
66
  # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-count
74
67
  #
@@ -83,11 +76,16 @@ module Elasticsearch
83
76
  arguments = arguments.clone
84
77
  headers = arguments.delete(:headers) || {}
85
78
 
86
- body = nil
79
+ body = arguments.delete(:body)
87
80
 
88
81
  _index = arguments.delete(:index)
89
82
 
90
- method = Elasticsearch::API::HTTP_GET
83
+ method = if body
84
+ Elasticsearch::API::HTTP_POST
85
+ else
86
+ Elasticsearch::API::HTTP_GET
87
+ end
88
+
91
89
  path = if _index
92
90
  "_cat/count/#{Utils.listify(_index)}"
93
91
  else
@@ -32,8 +32,6 @@ module Elasticsearch
32
32
  # - total store size of all shards, including shard replicas
33
33
  # These metrics are retrieved directly from Lucene, which Elasticsearch uses internally to power indexing and search. As a result, all document counts include hidden nested documents.
34
34
  # To get an accurate count of Elasticsearch documents, use the cat count or count APIs.
35
- # NOTE: Storage metrics reported by this API reflect the post-compression size of the indices on disk. Because these values are calculated after Elasticsearch compresses the data and processes deletions, they are typically significantly smaller than the raw, uncompressed data volume ingested.
36
- # IMPORTANT: For Elastic Cloud Serverless, ingest billing is based on the raw, uncompressed data volume, not the post-compression metrics reported here. To learn more, refer to {https://www.elastic.co/docs/deploy-manage/cloud-organization/billing/elasticsearch-billing-dimensions Elasticsearch billing dimensions}.
37
35
  # CAT APIs are only intended for human consumption using the command line or Kibana console.
38
36
  # They are not intended for use by applications. For application consumption, use an index endpoint.
39
37
  #
@@ -36,7 +36,7 @@ module Elasticsearch
36
36
  # @option arguments [Boolean] :dry_run If true, then the request simulates the operation.
37
37
  # It will calculate the result of applying the commands to the current cluster state and return the resulting cluster state after the commands (and rebalancing) have been applied; it will not actually perform the requested changes.
38
38
  # @option arguments [Boolean] :explain If true, then the response contains an explanation of why the commands can or cannot run.
39
- # @option arguments [String, Array<String>] :metric Limits the information returned to the specified metrics. Server default: all.
39
+ # @option arguments [String, Array<String>] :metric Limits the information returned to the specified metrics.
40
40
  # @option arguments [Boolean] :retry_failed If true, then retries allocation of shards that are blocked due to too many subsequent allocation failures.
41
41
  # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
42
42
  # @option arguments [Time] :timeout Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
@@ -59,6 +59,7 @@ module Elasticsearch
59
59
  request_opts[:defined_params] = defined_params unless defined_params.empty?
60
60
 
61
61
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
62
+
62
63
  unless arguments[:connector_sync_job_id]
63
64
  raise ArgumentError,
64
65
  "Required argument 'connector_sync_job_id' missing"
@@ -56,6 +56,7 @@ module Elasticsearch
56
56
  request_opts[:defined_params] = defined_params unless defined_params.empty?
57
57
 
58
58
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
59
+
59
60
  unless arguments[:connector_sync_job_id]
60
61
  raise ArgumentError,
61
62
  "Required argument 'connector_sync_job_id' missing"
@@ -58,6 +58,7 @@ module Elasticsearch
58
58
  request_opts[:defined_params] = defined_params unless defined_params.empty?
59
59
 
60
60
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
61
+
61
62
  unless arguments[:connector_sync_job_id]
62
63
  raise ArgumentError,
63
64
  "Required argument 'connector_sync_job_id' missing"
@@ -54,15 +54,7 @@ module Elasticsearch
54
54
  # @option arguments [Float] :min_score The minimum `_score` value that documents must have to be included in the result.
55
55
  # @option arguments [String] :preference The node or shard the operation should be performed on.
56
56
  # By default, it is random.
57
- # @option arguments [String] :project_routing Specifies a subset of projects to target for the search using project
58
- # metadata tags in a subset of Lucene query syntax.
59
- # Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded).
60
- # Examples:
61
- # _alias:my-project
62
- # _alias:_origin
63
- # _alias:*pr*
64
- # Supported in serverless only.
65
- # @option arguments [String] :routing A custom value used to route operations to a specific shard.
57
+ # @option arguments [String, Array<String>] :routing A custom value used to route operations to a specific shard.
66
58
  # @option arguments [Integer] :terminate_after The maximum number of documents to collect for each shard.
67
59
  # If a query reaches this limit, Elasticsearch terminates the query early.
68
60
  # Elasticsearch collects documents before sorting.IMPORTANT: Use with caution.
@@ -86,7 +86,7 @@ module Elasticsearch
86
86
  # If `false`, it does nothing with refreshes. Server default: false.
87
87
  # @option arguments [Boolean] :require_alias If `true`, the destination must be an index alias.
88
88
  # @option arguments [Boolean] :require_data_stream If `true`, the request's actions must target a data stream (existing or to be created).
89
- # @option arguments [String] :routing A custom value that is used to route operations to a specific shard.
89
+ # @option arguments [String, Array<String>] :routing A custom value that is used to route operations to a specific shard.
90
90
  # @option arguments [Time] :timeout The period the request waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards.
91
91
  # Elasticsearch waits for at least the specified timeout period before failing.
92
92
  # The actual wait time could be longer, particularly when multiple waits occur.This parameter is useful for situations where the primary shard assigned to perform the operation might not be available when the operation runs.
@@ -56,7 +56,7 @@ module Elasticsearch
56
56
  # @option arguments [String] :refresh If `true`, Elasticsearch refreshes the affected shards to make this operation visible to search.
57
57
  # If `wait_for`, it waits for a refresh to make this operation visible to search.
58
58
  # If `false`, it does nothing with refreshes. Server default: false.
59
- # @option arguments [String] :routing A custom value used to route operations to a specific shard.
59
+ # @option arguments [String, Array<String>] :routing A custom value used to route operations to a specific shard.
60
60
  # @option arguments [Time] :timeout The period to wait for active shards.This parameter is useful for situations where the primary shard assigned to perform the delete operation might not be available when the delete operation runs.
61
61
  # Some reasons for this might be that the primary shard is currently recovering from a store or undergoing relocation.
62
62
  # By default, the delete operation will wait on the primary shard to become available for up to 1 minute before failing and responding with an error. Server default: 1m.
@@ -115,7 +115,7 @@ module Elasticsearch
115
115
  # @option arguments [Boolean] :request_cache If `true`, the request cache is used for this request.
116
116
  # Defaults to the index-level setting.
117
117
  # @option arguments [Float] :requests_per_second The throttle for this request in sub-requests per second. Server default: -1.
118
- # @option arguments [String] :routing A custom value used to route operations to a specific shard.
118
+ # @option arguments [String, Array<String>] :routing A custom value used to route operations to a specific shard.
119
119
  # @option arguments [String] :q A query in the Lucene query string syntax.
120
120
  # @option arguments [Time] :scroll The period to retain the search context for scrolling.
121
121
  # @option arguments [Integer] :scroll_size The size of the scroll request that powers the operation. Server default: 1000.
@@ -37,14 +37,6 @@ module Elasticsearch
37
37
  # @option arguments [Boolean] :ignore_unavailable If true, missing or closed indices are not included in the response. Server default: true.
38
38
  # @option arguments [Time] :keep_alive Period for which the search and its results are stored on the cluster. Server default: 5d.
39
39
  # @option arguments [Boolean] :keep_on_completion If true, the search and its results are stored on the cluster.
40
- # @option arguments [String] :project_routing Specifies a subset of projects to target for the search using project
41
- # metadata tags in a subset of Lucene query syntax.
42
- # Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded).
43
- # Examples:
44
- # _alias:my-project
45
- # _alias:_origin
46
- # _alias:*pr*
47
- # Supported in serverless only.
48
40
  # @option arguments [Time] :wait_for_completion_timeout Timeout duration to wait for the request to finish. Defaults to no timeout, meaning the request waits for complete search results.
49
41
  # @option arguments [Boolean] :error_trace When set to `true` Elasticsearch will include the full stack trace of errors
50
42
  # when they occur.
@@ -0,0 +1,75 @@
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+ #
18
+ # This code was automatically generated from the Elasticsearch Specification
19
+ # See https://github.com/elastic/elasticsearch-specification
20
+ # See Elasticsearch::ES_SPECIFICATION_COMMIT for commit hash.
21
+ module Elasticsearch
22
+ module API
23
+ module Esql
24
+ module Actions
25
+ # Delete an ES|QL view.
26
+ # Deletes a stored ES|QL view.
27
+ # This functionality is in technical preview and may be changed or removed in a future
28
+ # release. Elastic will apply best effort to fix any issues, but features in technical
29
+ # preview are not subject to the support SLA of official GA features.
30
+ #
31
+ # @option arguments [String] :name The view name to remove. (*Required*)
32
+ # @option arguments [Boolean] :error_trace When set to `true` Elasticsearch will include the full stack trace of errors
33
+ # when they occur.
34
+ # @option arguments [String, Array<String>] :filter_path Comma-separated list of filters in dot notation which reduce the response
35
+ # returned by Elasticsearch.
36
+ # @option arguments [Boolean] :human When set to `true` will return statistics in a format suitable for humans.
37
+ # For example `"exists_time": "1h"` for humans and
38
+ # `"exists_time_in_millis": 3600000` for computers. When disabled the human
39
+ # readable values will be omitted. This makes sense for responses being consumed
40
+ # only by machines.
41
+ # @option arguments [Boolean] :pretty If set to `true` the returned JSON will be "pretty-formatted". Only use
42
+ # this option for debugging only.
43
+ # @option arguments [Hash] :headers Custom HTTP headers
44
+ #
45
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch#TODO
46
+ #
47
+ def delete_view(arguments = {})
48
+ request_opts = { endpoint: arguments[:endpoint] || 'esql.delete_view' }
49
+
50
+ defined_params = [:name].each_with_object({}) do |variable, set_variables|
51
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
52
+ end
53
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
54
+
55
+ raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]
56
+
57
+ arguments = arguments.clone
58
+ headers = arguments.delete(:headers) || {}
59
+
60
+ body = nil
61
+
62
+ _name = arguments.delete(:name)
63
+
64
+ method = Elasticsearch::API::HTTP_DELETE
65
+ path = "_query/view/#{Utils.listify(_name)}"
66
+ params = Utils.process_params(arguments)
67
+
68
+ Elasticsearch::API::Response.new(
69
+ perform_request(method, path, params, body, headers, request_opts)
70
+ )
71
+ end
72
+ end
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,77 @@
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+ #
18
+ # This code was automatically generated from the Elasticsearch Specification
19
+ # See https://github.com/elastic/elasticsearch-specification
20
+ # See Elasticsearch::ES_SPECIFICATION_COMMIT for commit hash.
21
+ module Elasticsearch
22
+ module API
23
+ module Esql
24
+ module Actions
25
+ # Get an ES|QL view.
26
+ # Returns a stored ES|QL view.
27
+ # This functionality is in technical preview and may be changed or removed in a future
28
+ # release. Elastic will apply best effort to fix any issues, but features in technical
29
+ # preview are not subject to the support SLA of official GA features.
30
+ #
31
+ # @option arguments [String] :name The comma-separated view names to retrieve.
32
+ # @option arguments [Boolean] :error_trace When set to `true` Elasticsearch will include the full stack trace of errors
33
+ # when they occur.
34
+ # @option arguments [String, Array<String>] :filter_path Comma-separated list of filters in dot notation which reduce the response
35
+ # returned by Elasticsearch.
36
+ # @option arguments [Boolean] :human When set to `true` will return statistics in a format suitable for humans.
37
+ # For example `"exists_time": "1h"` for humans and
38
+ # `"exists_time_in_millis": 3600000` for computers. When disabled the human
39
+ # readable values will be omitted. This makes sense for responses being consumed
40
+ # only by machines.
41
+ # @option arguments [Boolean] :pretty If set to `true` the returned JSON will be "pretty-formatted". Only use
42
+ # this option for debugging only.
43
+ # @option arguments [Hash] :headers Custom HTTP headers
44
+ #
45
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch#TODO
46
+ #
47
+ def get_view(arguments = {})
48
+ request_opts = { endpoint: arguments[:endpoint] || 'esql.get_view' }
49
+
50
+ defined_params = [:name].each_with_object({}) do |variable, set_variables|
51
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
52
+ end
53
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
54
+
55
+ arguments = arguments.clone
56
+ headers = arguments.delete(:headers) || {}
57
+
58
+ body = nil
59
+
60
+ _name = arguments.delete(:name)
61
+
62
+ method = Elasticsearch::API::HTTP_GET
63
+ path = if _name
64
+ "_query/view/#{Utils.listify(_name)}"
65
+ else
66
+ '_query/view'
67
+ end
68
+ params = Utils.process_params(arguments)
69
+
70
+ Elasticsearch::API::Response.new(
71
+ perform_request(method, path, params, body, headers, request_opts)
72
+ )
73
+ end
74
+ end
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,76 @@
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+ #
18
+ # This code was automatically generated from the Elasticsearch Specification
19
+ # See https://github.com/elastic/elasticsearch-specification
20
+ # See Elasticsearch::ES_SPECIFICATION_COMMIT for commit hash.
21
+ module Elasticsearch
22
+ module API
23
+ module Esql
24
+ module Actions
25
+ # Create or update an ES|QL view.
26
+ # This functionality is in technical preview and may be changed or removed in a future
27
+ # release. Elastic will apply best effort to fix any issues, but features in technical
28
+ # preview are not subject to the support SLA of official GA features.
29
+ #
30
+ # @option arguments [String] :name The view name to create or update. (*Required*)
31
+ # @option arguments [Boolean] :error_trace When set to `true` Elasticsearch will include the full stack trace of errors
32
+ # when they occur.
33
+ # @option arguments [String, Array<String>] :filter_path Comma-separated list of filters in dot notation which reduce the response
34
+ # returned by Elasticsearch.
35
+ # @option arguments [Boolean] :human When set to `true` will return statistics in a format suitable for humans.
36
+ # For example `"exists_time": "1h"` for humans and
37
+ # `"exists_time_in_millis": 3600000` for computers. When disabled the human
38
+ # readable values will be omitted. This makes sense for responses being consumed
39
+ # only by machines.
40
+ # @option arguments [Boolean] :pretty If set to `true` the returned JSON will be "pretty-formatted". Only use
41
+ # this option for debugging only.
42
+ # @option arguments [Hash] :headers Custom HTTP headers
43
+ # @option arguments [Hash] :body request body
44
+ #
45
+ # @see https://www.elastic.co/docs/api/doc/elasticsearch#TODO
46
+ #
47
+ def put_view(arguments = {})
48
+ request_opts = { endpoint: arguments[:endpoint] || 'esql.put_view' }
49
+
50
+ defined_params = [:name].each_with_object({}) do |variable, set_variables|
51
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
52
+ end
53
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
54
+
55
+ raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
56
+ raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]
57
+
58
+ arguments = arguments.clone
59
+ headers = arguments.delete(:headers) || {}
60
+
61
+ body = arguments.delete(:body)
62
+
63
+ _name = arguments.delete(:name)
64
+
65
+ method = Elasticsearch::API::HTTP_PUT
66
+ path = "_query/view/#{Utils.listify(_name)}"
67
+ params = Utils.process_params(arguments)
68
+
69
+ Elasticsearch::API::Response.new(
70
+ perform_request(method, path, params, body, headers, request_opts)
71
+ )
72
+ end
73
+ end
74
+ end
75
+ end
76
+ end
@@ -48,7 +48,7 @@ module Elasticsearch
48
48
  # @option arguments [Boolean] :realtime If `true`, the request is real-time as opposed to near-real-time. Server default: true.
49
49
  # @option arguments [Boolean] :refresh If `true`, the request refreshes the relevant shards before retrieving the document.
50
50
  # Setting it to `true` should be done after careful thought and verification that this does not cause a heavy load on the system (and slow down indexing).
51
- # @option arguments [String] :routing A custom value used to route operations to a specific shard.
51
+ # @option arguments [String, Array<String>] :routing A custom value used to route operations to a specific shard.
52
52
  # @option arguments [Boolean, String, Array<String>] :_source Indicates whether to return the `_source` field (`true` or `false`) or lists the fields to return.
53
53
  # @option arguments [String, Array<String>] :_source_excludes A comma-separated list of source fields to exclude from the response.
54
54
  # You can also use this parameter to exclude fields from the subset specified in `_source_includes` query parameter.
@@ -39,7 +39,7 @@ module Elasticsearch
39
39
  # @option arguments [Boolean] :realtime If `true`, the request is real-time as opposed to near-real-time. Server default: true.
40
40
  # @option arguments [Boolean] :refresh If `true`, the request refreshes the relevant shards before retrieving the document.
41
41
  # Setting it to `true` should be done after careful thought and verification that this does not cause a heavy load on the system (and slow down indexing).
42
- # @option arguments [String] :routing A custom value used to route operations to a specific shard.
42
+ # @option arguments [String, Array<String>] :routing A custom value used to route operations to a specific shard.
43
43
  # @option arguments [Boolean, String, Array<String>] :_source Indicates whether to return the `_source` field (`true` or `false`) or lists the fields to return.
44
44
  # @option arguments [String, Array<String>] :_source_excludes A comma-separated list of source fields to exclude in the response.
45
45
  # @option arguments [String, Array<String>] :_source_includes A comma-separated list of source fields to include in the response.
@@ -40,7 +40,7 @@ module Elasticsearch
40
40
  # This parameter can be used only when the `q` query string parameter is specified.
41
41
  # @option arguments [String] :preference The node or shard the operation should be performed on.
42
42
  # It is random by default.
43
- # @option arguments [String] :routing A custom value used to route operations to a specific shard.
43
+ # @option arguments [String, Array<String>] :routing A custom value used to route operations to a specific shard.
44
44
  # @option arguments [Boolean, String, Array<String>] :_source `True` or `false` to return the `_source` field or not or a list of fields to return.
45
45
  # @option arguments [String, Array<String>] :_source_excludes A comma-separated list of source fields to exclude from the response.
46
46
  # You can also use this parameter to exclude fields from the subset specified in `_source_includes` query parameter.
@@ -35,19 +35,11 @@ module Elasticsearch
35
35
  # @option arguments [String, Array<String>] :fields A comma-separated list of fields to retrieve capabilities for. Wildcard (`*`) expressions are supported.
36
36
  # @option arguments [Boolean] :ignore_unavailable If `true`, missing or closed indices are not included in the response.
37
37
  # @option arguments [Boolean] :include_unmapped If true, unmapped fields are included in the response.
38
- # @option arguments [String] :filters A comma-separated list of filters to apply to the response.
38
+ # @option arguments [String, Array<String>] :filters A comma-separated list of filters to apply to the response.
39
39
  # @option arguments [Array<String>] :types A comma-separated list of field types to include.
40
40
  # Any fields that do not match one of these types will be excluded from the results.
41
41
  # It defaults to empty, meaning that all field types are returned.
42
42
  # @option arguments [Boolean] :include_empty_fields If false, empty fields are not included in the response. Server default: true.
43
- # @option arguments [String] :project_routing Specifies a subset of projects to target for the field-caps query using project
44
- # metadata tags in a subset of Lucene query syntax.
45
- # Allowed Lucene queries: the _alias tag and a single value (possibly wildcarded).
46
- # Examples:
47
- # _alias:my-project
48
- # _alias:_origin
49
- # _alias:*pr*
50
- # Supported in serverless only.
51
43
  # @option arguments [Boolean] :error_trace When set to `true` Elasticsearch will include the full stack trace of errors
52
44
  # when they occur.
53
45
  # @option arguments [String, Array<String>] :filter_path Comma-separated list of filters in dot notation which reduce the response
@@ -47,7 +47,7 @@ module Elasticsearch
47
47
  # @option arguments [String] :preference [TODO]
48
48
  # @option arguments [Integer] :pre_filter_shard_size [TODO]
49
49
  # @option arguments [Boolean] :request_cache [TODO]
50
- # @option arguments [String] :routing [TODO]
50
+ # @option arguments [String, Array<String>] :routing [TODO]
51
51
  # @option arguments [Time] :scroll [TODO]
52
52
  # @option arguments [String] :search_type [TODO]
53
53
  # @option arguments [Array<String>] :stats [TODO]
@@ -83,7 +83,7 @@ module Elasticsearch
83
83
  # @option arguments [Boolean] :realtime If `true`, the request is real-time as opposed to near-real-time. Server default: true.
84
84
  # @option arguments [Boolean] :refresh If `true`, the request refreshes the relevant shards before retrieving the document.
85
85
  # Setting it to `true` should be done after careful thought and verification that this does not cause a heavy load on the system (and slow down indexing).
86
- # @option arguments [String] :routing A custom value used to route operations to a specific shard.
86
+ # @option arguments [String, Array<String>] :routing A custom value used to route operations to a specific shard.
87
87
  # @option arguments [Boolean, String, Array<String>] :_source Indicates whether to return the `_source` field (`true` or `false`) or lists the fields to return.
88
88
  # @option arguments [String, Array<String>] :_source_excludes A comma-separated list of source fields to exclude from the response.
89
89
  # You can also use this parameter to exclude fields from the subset specified in `_source_includes` query parameter.
@@ -42,7 +42,7 @@ module Elasticsearch
42
42
  # @option arguments [Boolean] :realtime If `true`, the request is real-time as opposed to near-real-time. Server default: true.
43
43
  # @option arguments [Boolean] :refresh If `true`, the request refreshes the relevant shards before retrieving the document.
44
44
  # Setting it to `true` should be done after careful thought and verification that this does not cause a heavy load on the system (and slow down indexing).
45
- # @option arguments [String] :routing A custom value used to route operations to a specific shard.
45
+ # @option arguments [String, Array<String>] :routing A custom value used to route operations to a specific shard.
46
46
  # @option arguments [Boolean, String, Array<String>] :_source Indicates whether to return the `_source` field (`true` or `false`) or lists the fields to return.
47
47
  # @option arguments [String, Array<String>] :_source_excludes A comma-separated list of source fields to exclude in the response.
48
48
  # @option arguments [String, Array<String>] :_source_includes A comma-separated list of source fields to include in the response.