elasticsearch 8.9.0 → 9.4.3
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.
- checksums.yaml +4 -4
- data/elasticsearch.gemspec +14 -11
- data/lib/elasticsearch/helpers/bulk_helper.rb +11 -6
- data/lib/elasticsearch/helpers/esql_helper.rb +72 -0
- data/lib/elasticsearch/helpers/scroll_helper.rb +4 -14
- data/lib/elasticsearch/version.rb +1 -1
- data/lib/elasticsearch.rb +42 -9
- metadata +50 -52
- data/Gemfile +0 -27
- data/Rakefile +0 -54
- data/spec/integration/characters_escaping_spec.rb +0 -94
- data/spec/integration/client_integration_spec.rb +0 -63
- data/spec/integration/helpers/bulk_helper_spec.rb +0 -211
- data/spec/integration/helpers/scroll_helper_spec.rb +0 -91
- data/spec/spec_helper.rb +0 -31
- data/spec/unit/api_key_spec.rb +0 -137
- data/spec/unit/cloud_credentials_spec.rb +0 -167
- data/spec/unit/custom_transport_implementation_spec.rb +0 -43
- data/spec/unit/elasticsearch_product_validation_spec.rb +0 -148
- data/spec/unit/headers_spec.rb +0 -55
- data/spec/unit/opaque_id_spec.rb +0 -48
- data/spec/unit/user_agent_spec.rb +0 -69
- data/spec/unit/wrapper_gem_spec.rb +0 -33
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 47b6cc8b0a52d4dc4ac552ec22d1959c2c9602db96be329fdd0552556fa722dd
|
|
4
|
+
data.tar.gz: 830cb8d5308c0506b52087041f85b712238d0e9a6403f48865a71a6fd063f863
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b2dea34f6df46388fe584481b8ac86b7b1c575e8f2c7a6a30c3bf4f07a9b0737d4c40ee38dc7b2478c71bec11f28185f98a6aa4b9ccacc74c8b78b24003a90ce
|
|
7
|
+
data.tar.gz: 03f64a5bf86cffe351346cdf4411f7c4a6b05b119d45c27f08d49c19e0f0ec33603dadbe695869910110bfb099f06db6da7d61dbc0bb73a5c4ea17d4f1b5d194
|
data/elasticsearch.gemspec
CHANGED
|
@@ -15,15 +15,15 @@
|
|
|
15
15
|
# specific language governing permissions and limitations
|
|
16
16
|
# under the License.
|
|
17
17
|
|
|
18
|
-
lib = File.expand_path('
|
|
18
|
+
lib = File.expand_path('lib', __dir__)
|
|
19
19
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
20
20
|
require 'elasticsearch/version'
|
|
21
21
|
|
|
22
22
|
Gem::Specification.new do |s|
|
|
23
23
|
s.name = 'elasticsearch'
|
|
24
24
|
s.version = Elasticsearch::VERSION
|
|
25
|
-
s.authors = ['
|
|
26
|
-
s.email = ['
|
|
25
|
+
s.authors = ['Elastic Client Library Maintainers']
|
|
26
|
+
s.email = ['client-libs@elastic.co']
|
|
27
27
|
s.summary = 'Ruby integrations for Elasticsearch'
|
|
28
28
|
s.homepage = 'https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/current/index.html'
|
|
29
29
|
s.license = 'Apache-2.0'
|
|
@@ -33,30 +33,33 @@ Gem::Specification.new do |s|
|
|
|
33
33
|
'source_code_uri' => 'https://github.com/elastic/elasticsearch-ruby/tree/main',
|
|
34
34
|
'bug_tracker_uri' => 'https://github.com/elastic/elasticsearch-ruby/issues'
|
|
35
35
|
}
|
|
36
|
-
s.files = `git ls-files`.split($/)
|
|
36
|
+
s.files = `git ls-files`.split($/).reject do |file|
|
|
37
|
+
file.match(/^spec\/|^Gemfile|^Rakefile/)
|
|
38
|
+
end
|
|
39
|
+
|
|
37
40
|
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
38
41
|
s.executables << 'elastic_ruby_console'
|
|
39
|
-
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
|
40
42
|
s.require_paths = ['lib']
|
|
41
43
|
s.bindir = 'bin'
|
|
42
44
|
|
|
43
45
|
s.extra_rdoc_files = ['README.md', 'LICENSE.txt']
|
|
44
46
|
s.rdoc_options = ['--charset=UTF-8']
|
|
45
47
|
|
|
46
|
-
s.required_ruby_version = '>= 2.
|
|
47
|
-
|
|
48
|
-
s.add_dependency 'elastic-transport', '~> 8'
|
|
49
|
-
s.add_dependency 'elasticsearch-api', '8.9.0'
|
|
48
|
+
s.required_ruby_version = '>= 2.6' # For compatibility with JRuby 9.3
|
|
49
|
+
s.add_dependency 'elasticsearch-api', '9.4.3'
|
|
50
|
+
s.add_dependency 'elastic-transport', '~> 8.3'
|
|
50
51
|
|
|
52
|
+
s.add_development_dependency 'base64'
|
|
51
53
|
s.add_development_dependency 'bundler'
|
|
52
|
-
s.add_development_dependency '
|
|
54
|
+
s.add_development_dependency 'debug' unless defined?(JRUBY_VERSION)
|
|
55
|
+
s.add_development_dependency 'ostruct'
|
|
53
56
|
s.add_development_dependency 'pry'
|
|
54
57
|
s.add_development_dependency 'rake'
|
|
55
58
|
s.add_development_dependency 'require-prof' unless defined?(JRUBY_VERSION) || defined?(Rubinius)
|
|
56
59
|
s.add_development_dependency 'rspec'
|
|
57
60
|
s.add_development_dependency 'ruby-prof' unless defined?(JRUBY_VERSION) || defined?(Rubinius)
|
|
58
61
|
s.add_development_dependency 'simplecov'
|
|
59
|
-
s.add_development_dependency 'webmock'
|
|
62
|
+
s.add_development_dependency 'webmock', '> 3.23'
|
|
60
63
|
s.add_development_dependency 'yard'
|
|
61
64
|
|
|
62
65
|
s.description = <<-DESC.gsub(/^ /, '')
|
|
@@ -48,7 +48,9 @@ module Elasticsearch
|
|
|
48
48
|
def ingest(docs, params = {}, body = {}, &block)
|
|
49
49
|
ingest_docs = docs.map { |doc| { index: { _index: @index, data: doc} } }
|
|
50
50
|
if (slice = params.delete(:slice))
|
|
51
|
-
ingest_docs.each_slice(slice)
|
|
51
|
+
ingest_docs.each_slice(slice) do |items|
|
|
52
|
+
ingest(items.map { |item| item[:index][:data] }, params, &block)
|
|
53
|
+
end
|
|
52
54
|
else
|
|
53
55
|
bulk_request(ingest_docs, params, &block)
|
|
54
56
|
end
|
|
@@ -74,12 +76,15 @@ module Elasticsearch
|
|
|
74
76
|
# @yieldparam ingest_docs [Array<Hash>] The collection of documents sent in the bulk request.
|
|
75
77
|
#
|
|
76
78
|
def update(docs, params = {}, body = {}, &block)
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
ingest_docs.each_slice(slice) { |items| update(items, params, &block) }
|
|
79
|
+
if (slice = params[:slice])
|
|
80
|
+
request_params = params.dup
|
|
81
|
+
request_params.delete(:slice)
|
|
82
|
+
docs.each_slice(slice) { |items| update(items, request_params, &block) }
|
|
82
83
|
else
|
|
84
|
+
ingest_docs = docs.map do |doc|
|
|
85
|
+
document = doc.dup
|
|
86
|
+
{ update: { _index: @index, _id: document.delete('id'), data: { doc: document } } }
|
|
87
|
+
end
|
|
83
88
|
bulk_request(ingest_docs, params, &block)
|
|
84
89
|
end
|
|
85
90
|
end
|
|
@@ -0,0 +1,72 @@
|
|
|
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
|
+
module Elasticsearch
|
|
19
|
+
module Helpers
|
|
20
|
+
# Elasticsearch Client Helper for the ES|QL API
|
|
21
|
+
#
|
|
22
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/esql-query-api.html
|
|
23
|
+
#
|
|
24
|
+
module ESQLHelper
|
|
25
|
+
# Query helper for ES|QL
|
|
26
|
+
#
|
|
27
|
+
# By default, the `esql.query` API returns a Hash response with the following keys:
|
|
28
|
+
#
|
|
29
|
+
# * `columns` with the value being an Array of `{ name: type }` Hashes for each column.
|
|
30
|
+
#
|
|
31
|
+
# * `values` with the value being an Array of Arrays with the values for each row.
|
|
32
|
+
#
|
|
33
|
+
# This helper function returns an Array of hashes with the columns as keys and the respective
|
|
34
|
+
# values: `{ column['name'] => value }`.
|
|
35
|
+
#
|
|
36
|
+
# @param client [Elasticsearch::Client] an instance of the Client to use for the query.
|
|
37
|
+
# @param query [Hash, String] The query to be passed to the ES|QL query API.
|
|
38
|
+
# @param params [Hash] options to pass to the ES|QL query API.
|
|
39
|
+
# @param parser [Hash] Hash of column name keys and Proc values to transform the value of
|
|
40
|
+
# a given column.
|
|
41
|
+
# @example Using the ES|QL helper
|
|
42
|
+
# require 'elasticsearch/helpers/esql_helper'
|
|
43
|
+
# query = <<~ESQL
|
|
44
|
+
# FROM sample_data
|
|
45
|
+
# | EVAL duration_ms = ROUND(event.duration / 1000000.0, 1)
|
|
46
|
+
# ESQL
|
|
47
|
+
# response = Elasticsearch::Helpers::ESQLHelper.query(client, query)
|
|
48
|
+
#
|
|
49
|
+
# @example Using the ES|QL helper with a parser
|
|
50
|
+
# response = Elasticsearch::Helpers::ESQLHelper.query(
|
|
51
|
+
# client,
|
|
52
|
+
# query,
|
|
53
|
+
# parser: { '@timestamp' => Proc.new { |t| DateTime.parse(t) } }
|
|
54
|
+
# )
|
|
55
|
+
#
|
|
56
|
+
# @see https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/current/Helpers.html#_esql_helper
|
|
57
|
+
#
|
|
58
|
+
def self.query(client, query, params = {}, parser: {})
|
|
59
|
+
response = client.esql.query({ body: { query: query }, format: 'json' }.merge(params))
|
|
60
|
+
|
|
61
|
+
columns = response['columns']
|
|
62
|
+
response['values'].map do |value|
|
|
63
|
+
(value.length - 1).downto(0).map do |index|
|
|
64
|
+
key = columns[index]['name']
|
|
65
|
+
value[index] = parser[key].call(value[index]) if value[index] && parser[key]
|
|
66
|
+
{ key => value[index] }
|
|
67
|
+
end.reduce({}, :merge)
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
@@ -43,12 +43,8 @@ module Elasticsearch
|
|
|
43
43
|
# @yieldparam document [Hash] yields a document found in the search hits.
|
|
44
44
|
#
|
|
45
45
|
def each(&block)
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
refresh_docs
|
|
49
|
-
for doc in @docs do
|
|
50
|
-
refresh_docs
|
|
51
|
-
yield doc
|
|
46
|
+
until (docs = results).empty?
|
|
47
|
+
docs.each(&block)
|
|
52
48
|
end
|
|
53
49
|
clear
|
|
54
50
|
end
|
|
@@ -70,17 +66,11 @@ module Elasticsearch
|
|
|
70
66
|
#
|
|
71
67
|
def clear
|
|
72
68
|
@client.clear_scroll(body: { scroll_id: @scroll_id }) if @scroll_id
|
|
73
|
-
@
|
|
69
|
+
@scroll_id = nil
|
|
74
70
|
end
|
|
75
71
|
|
|
76
72
|
private
|
|
77
73
|
|
|
78
|
-
def refresh_docs
|
|
79
|
-
@docs ||= []
|
|
80
|
-
@docs << results
|
|
81
|
-
@docs.flatten!
|
|
82
|
-
end
|
|
83
|
-
|
|
84
74
|
def initial_search
|
|
85
75
|
response = @client.search(index: @index, scroll: @scroll, body: @body)
|
|
86
76
|
@scroll_id = response['_scroll_id']
|
|
@@ -88,7 +78,7 @@ module Elasticsearch
|
|
|
88
78
|
end
|
|
89
79
|
|
|
90
80
|
def scroll_request
|
|
91
|
-
@client.scroll(body: {scroll: @scroll, scroll_id: @scroll_id})['hits']['hits']
|
|
81
|
+
@client.scroll(body: { scroll: @scroll, scroll_id: @scroll_id })['hits']['hits']
|
|
92
82
|
end
|
|
93
83
|
end
|
|
94
84
|
end
|
data/lib/elasticsearch.rb
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
# specific language governing permissions and limitations
|
|
16
16
|
# under the License.
|
|
17
17
|
|
|
18
|
+
require 'base64'
|
|
18
19
|
require 'elasticsearch/version'
|
|
19
20
|
require 'elastic/transport'
|
|
20
21
|
require 'elasticsearch/api'
|
|
@@ -37,8 +38,9 @@ module Elasticsearch
|
|
|
37
38
|
#
|
|
38
39
|
# @param [Hash] arguments - initializer arguments
|
|
39
40
|
# @option arguments [String] :cloud_id - The Cloud ID to connect to Elastic Cloud
|
|
40
|
-
# @option arguments [String, Hash] :api_key Use API Key Authentication, either the base64 encoding of `id` and
|
|
41
|
-
# joined by a colon as a String, or a hash with the `id` and
|
|
41
|
+
# @option arguments [String, Hash] :api_key Use API Key Authentication, either the base64 encoding of `id` and
|
|
42
|
+
# `api_key` joined by a colon as a String, or a hash with the `id` and
|
|
43
|
+
# `api_key` values.
|
|
42
44
|
# @option arguments [String] :opaque_id_prefix set a prefix for X-Opaque-Id when initializing the client.
|
|
43
45
|
# This will be prepended to the id you set before each request
|
|
44
46
|
# if you're using X-Opaque-Id
|
|
@@ -51,6 +53,7 @@ module Elasticsearch
|
|
|
51
53
|
api_key(arguments) if arguments[:api_key]
|
|
52
54
|
setup_cloud(arguments) if arguments[:cloud_id]
|
|
53
55
|
set_user_agent!(arguments) unless sent_user_agent?(arguments)
|
|
56
|
+
set_content_type!(arguments)
|
|
54
57
|
@transport = Elastic::Transport::Client.new(arguments, &block)
|
|
55
58
|
end
|
|
56
59
|
|
|
@@ -59,16 +62,16 @@ module Elasticsearch
|
|
|
59
62
|
super
|
|
60
63
|
elsif name == :perform_request
|
|
61
64
|
# The signature for perform_request is:
|
|
62
|
-
# method, path, params, body, headers
|
|
65
|
+
# method, path, params, body, headers, opts
|
|
63
66
|
if (opaque_id = args[2]&.delete(:opaque_id))
|
|
64
67
|
headers = args[4] || {}
|
|
65
68
|
opaque_id = @opaque_id_prefix ? "#{@opaque_id_prefix}#{opaque_id}" : opaque_id
|
|
66
69
|
args[4] = headers.merge('X-Opaque-Id' => opaque_id)
|
|
67
70
|
end
|
|
68
|
-
|
|
69
|
-
verify_elasticsearch(*args, &block)
|
|
70
|
-
else
|
|
71
|
+
if @verified
|
|
71
72
|
@transport.perform_request(*args, &block)
|
|
73
|
+
else
|
|
74
|
+
verify_elasticsearch(*args, &block)
|
|
72
75
|
end
|
|
73
76
|
else
|
|
74
77
|
@transport.send(name, *args, &block)
|
|
@@ -79,6 +82,12 @@ module Elasticsearch
|
|
|
79
82
|
@transport.respond_to?(method_name) || super
|
|
80
83
|
end
|
|
81
84
|
|
|
85
|
+
# Helper function that packs a dense vector for efficient uploading.
|
|
86
|
+
# @param data - the array to pack.
|
|
87
|
+
def pack_dense_vector(data)
|
|
88
|
+
Base64.strict_encode64(data.pack('g' * data.size))
|
|
89
|
+
end
|
|
90
|
+
|
|
82
91
|
private
|
|
83
92
|
|
|
84
93
|
def verify_elasticsearch(*args, &block)
|
|
@@ -101,13 +110,15 @@ module Elasticsearch
|
|
|
101
110
|
raise e
|
|
102
111
|
end
|
|
103
112
|
raise Elasticsearch::UnsupportedProductError unless response.headers['x-elastic-product'] == 'Elasticsearch'
|
|
113
|
+
|
|
104
114
|
@verified = true
|
|
105
115
|
response
|
|
106
116
|
end
|
|
107
117
|
|
|
108
118
|
def setup_cloud_host(cloud_id, user, password, port)
|
|
109
119
|
name = cloud_id.split(':')[0]
|
|
110
|
-
|
|
120
|
+
base64_decoded = cloud_id.gsub("#{name}:", '').unpack1('m')
|
|
121
|
+
cloud_url, elasticsearch_instance = base64_decoded.split('$')
|
|
111
122
|
|
|
112
123
|
if cloud_url.include?(':')
|
|
113
124
|
url, port = cloud_url.split(':')
|
|
@@ -149,7 +160,8 @@ module Elasticsearch
|
|
|
149
160
|
# Credentials is the base64 encoding of id and api_key joined by a colon
|
|
150
161
|
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html
|
|
151
162
|
def encode(api_key)
|
|
152
|
-
|
|
163
|
+
credentials = [api_key[:id], api_key[:api_key]].join(':')
|
|
164
|
+
[credentials].pack('m0')
|
|
153
165
|
end
|
|
154
166
|
|
|
155
167
|
def elasticsearch_validation_request
|
|
@@ -158,6 +170,7 @@ module Elasticsearch
|
|
|
158
170
|
|
|
159
171
|
def sent_user_agent?(arguments)
|
|
160
172
|
return unless (headers = arguments&.[](:transport_options)&.[](:headers))
|
|
173
|
+
|
|
161
174
|
!!headers.keys.detect { |h| h =~ /user-?_?agent/ }
|
|
162
175
|
end
|
|
163
176
|
|
|
@@ -170,9 +183,29 @@ module Elasticsearch
|
|
|
170
183
|
if RbConfig::CONFIG && RbConfig::CONFIG['host_os']
|
|
171
184
|
user_agent << "#{RbConfig::CONFIG['host_os'].split('_').first[/[a-z]+/i].downcase} #{RbConfig::CONFIG['target_cpu']}"
|
|
172
185
|
end
|
|
186
|
+
set_header({ user_agent: user_agent.join('; ') }, arguments)
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
def set_content_type!(arguments)
|
|
190
|
+
headers = {}
|
|
191
|
+
user_headers = arguments&.[](:transport_options)&.[](:headers)
|
|
192
|
+
unless user_headers&.keys&.detect { |h| h =~ /content-?_?type/i } || api_version_set?(user_headers)
|
|
193
|
+
headers['content-type'] = 'application/vnd.elasticsearch+json; compatible-with=9'
|
|
194
|
+
end
|
|
195
|
+
unless user_headers&.keys&.detect { |h| h =~ /accept/i } || api_version_set?(user_headers)
|
|
196
|
+
headers['accept'] = 'application/vnd.elasticsearch+json; compatible-with=9'
|
|
197
|
+
end
|
|
198
|
+
set_header(headers, arguments) unless headers.empty?
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
def api_version_set?(headers)
|
|
202
|
+
!!headers&.keys&.find { |a| a.match?(/elastic-api-version/i) }
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
def set_header(header, arguments)
|
|
173
206
|
arguments[:transport_options] ||= {}
|
|
174
207
|
arguments[:transport_options][:headers] ||= {}
|
|
175
|
-
arguments[:transport_options][:headers].merge!(
|
|
208
|
+
arguments[:transport_options][:headers].merge!(header)
|
|
176
209
|
end
|
|
177
210
|
end
|
|
178
211
|
|
metadata
CHANGED
|
@@ -1,43 +1,56 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: elasticsearch
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 9.4.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
|
-
-
|
|
8
|
-
autorequire:
|
|
7
|
+
- Elastic Client Library Maintainers
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: elasticsearch-api
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - '='
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: 9.4.3
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - '='
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: 9.4.3
|
|
13
26
|
- !ruby/object:Gem::Dependency
|
|
14
27
|
name: elastic-transport
|
|
15
28
|
requirement: !ruby/object:Gem::Requirement
|
|
16
29
|
requirements:
|
|
17
30
|
- - "~>"
|
|
18
31
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '8'
|
|
32
|
+
version: '8.3'
|
|
20
33
|
type: :runtime
|
|
21
34
|
prerelease: false
|
|
22
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
36
|
requirements:
|
|
24
37
|
- - "~>"
|
|
25
38
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '8'
|
|
39
|
+
version: '8.3'
|
|
27
40
|
- !ruby/object:Gem::Dependency
|
|
28
|
-
name:
|
|
41
|
+
name: base64
|
|
29
42
|
requirement: !ruby/object:Gem::Requirement
|
|
30
43
|
requirements:
|
|
31
|
-
- -
|
|
44
|
+
- - ">="
|
|
32
45
|
- !ruby/object:Gem::Version
|
|
33
|
-
version:
|
|
34
|
-
type: :
|
|
46
|
+
version: '0'
|
|
47
|
+
type: :development
|
|
35
48
|
prerelease: false
|
|
36
49
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
50
|
requirements:
|
|
38
|
-
- -
|
|
51
|
+
- - ">="
|
|
39
52
|
- !ruby/object:Gem::Version
|
|
40
|
-
version:
|
|
53
|
+
version: '0'
|
|
41
54
|
- !ruby/object:Gem::Dependency
|
|
42
55
|
name: bundler
|
|
43
56
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -53,7 +66,21 @@ dependencies:
|
|
|
53
66
|
- !ruby/object:Gem::Version
|
|
54
67
|
version: '0'
|
|
55
68
|
- !ruby/object:Gem::Dependency
|
|
56
|
-
name:
|
|
69
|
+
name: debug
|
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
|
71
|
+
requirements:
|
|
72
|
+
- - ">="
|
|
73
|
+
- !ruby/object:Gem::Version
|
|
74
|
+
version: '0'
|
|
75
|
+
type: :development
|
|
76
|
+
prerelease: false
|
|
77
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
78
|
+
requirements:
|
|
79
|
+
- - ">="
|
|
80
|
+
- !ruby/object:Gem::Version
|
|
81
|
+
version: '0'
|
|
82
|
+
- !ruby/object:Gem::Dependency
|
|
83
|
+
name: ostruct
|
|
57
84
|
requirement: !ruby/object:Gem::Requirement
|
|
58
85
|
requirements:
|
|
59
86
|
- - ">="
|
|
@@ -154,16 +181,16 @@ dependencies:
|
|
|
154
181
|
name: webmock
|
|
155
182
|
requirement: !ruby/object:Gem::Requirement
|
|
156
183
|
requirements:
|
|
157
|
-
- - "
|
|
184
|
+
- - ">"
|
|
158
185
|
- !ruby/object:Gem::Version
|
|
159
|
-
version: '
|
|
186
|
+
version: '3.23'
|
|
160
187
|
type: :development
|
|
161
188
|
prerelease: false
|
|
162
189
|
version_requirements: !ruby/object:Gem::Requirement
|
|
163
190
|
requirements:
|
|
164
|
-
- - "
|
|
191
|
+
- - ">"
|
|
165
192
|
- !ruby/object:Gem::Version
|
|
166
|
-
version: '
|
|
193
|
+
version: '3.23'
|
|
167
194
|
- !ruby/object:Gem::Dependency
|
|
168
195
|
name: yard
|
|
169
196
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -182,39 +209,25 @@ description: 'Ruby integrations for Elasticsearch (client, API, etc.)
|
|
|
182
209
|
|
|
183
210
|
'
|
|
184
211
|
email:
|
|
185
|
-
-
|
|
212
|
+
- client-libs@elastic.co
|
|
186
213
|
executables:
|
|
187
214
|
- elastic_ruby_console
|
|
188
215
|
extensions: []
|
|
189
216
|
extra_rdoc_files:
|
|
190
|
-
- README.md
|
|
191
217
|
- LICENSE.txt
|
|
218
|
+
- README.md
|
|
192
219
|
files:
|
|
193
220
|
- ".gitignore"
|
|
194
|
-
- Gemfile
|
|
195
221
|
- LICENSE.txt
|
|
196
222
|
- README.md
|
|
197
|
-
- Rakefile
|
|
198
223
|
- bin/elastic_ruby_console
|
|
199
224
|
- elasticsearch.gemspec
|
|
200
225
|
- lib/elasticsearch-ruby.rb
|
|
201
226
|
- lib/elasticsearch.rb
|
|
202
227
|
- lib/elasticsearch/helpers/bulk_helper.rb
|
|
228
|
+
- lib/elasticsearch/helpers/esql_helper.rb
|
|
203
229
|
- lib/elasticsearch/helpers/scroll_helper.rb
|
|
204
230
|
- lib/elasticsearch/version.rb
|
|
205
|
-
- spec/integration/characters_escaping_spec.rb
|
|
206
|
-
- spec/integration/client_integration_spec.rb
|
|
207
|
-
- spec/integration/helpers/bulk_helper_spec.rb
|
|
208
|
-
- spec/integration/helpers/scroll_helper_spec.rb
|
|
209
|
-
- spec/spec_helper.rb
|
|
210
|
-
- spec/unit/api_key_spec.rb
|
|
211
|
-
- spec/unit/cloud_credentials_spec.rb
|
|
212
|
-
- spec/unit/custom_transport_implementation_spec.rb
|
|
213
|
-
- spec/unit/elasticsearch_product_validation_spec.rb
|
|
214
|
-
- spec/unit/headers_spec.rb
|
|
215
|
-
- spec/unit/opaque_id_spec.rb
|
|
216
|
-
- spec/unit/user_agent_spec.rb
|
|
217
|
-
- spec/unit/wrapper_gem_spec.rb
|
|
218
231
|
homepage: https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/current/index.html
|
|
219
232
|
licenses:
|
|
220
233
|
- Apache-2.0
|
|
@@ -223,7 +236,6 @@ metadata:
|
|
|
223
236
|
changelog_uri: https://github.com/elastic/elasticsearch-ruby/blob/main/CHANGELOG.md
|
|
224
237
|
source_code_uri: https://github.com/elastic/elasticsearch-ruby/tree/main
|
|
225
238
|
bug_tracker_uri: https://github.com/elastic/elasticsearch-ruby/issues
|
|
226
|
-
post_install_message:
|
|
227
239
|
rdoc_options:
|
|
228
240
|
- "--charset=UTF-8"
|
|
229
241
|
require_paths:
|
|
@@ -232,28 +244,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
232
244
|
requirements:
|
|
233
245
|
- - ">="
|
|
234
246
|
- !ruby/object:Gem::Version
|
|
235
|
-
version: '2.
|
|
247
|
+
version: '2.6'
|
|
236
248
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
237
249
|
requirements:
|
|
238
250
|
- - ">="
|
|
239
251
|
- !ruby/object:Gem::Version
|
|
240
252
|
version: '0'
|
|
241
253
|
requirements: []
|
|
242
|
-
rubygems_version:
|
|
243
|
-
signing_key:
|
|
254
|
+
rubygems_version: 4.0.12
|
|
244
255
|
specification_version: 4
|
|
245
256
|
summary: Ruby integrations for Elasticsearch
|
|
246
|
-
test_files:
|
|
247
|
-
- spec/integration/characters_escaping_spec.rb
|
|
248
|
-
- spec/integration/client_integration_spec.rb
|
|
249
|
-
- spec/integration/helpers/bulk_helper_spec.rb
|
|
250
|
-
- spec/integration/helpers/scroll_helper_spec.rb
|
|
251
|
-
- spec/spec_helper.rb
|
|
252
|
-
- spec/unit/api_key_spec.rb
|
|
253
|
-
- spec/unit/cloud_credentials_spec.rb
|
|
254
|
-
- spec/unit/custom_transport_implementation_spec.rb
|
|
255
|
-
- spec/unit/elasticsearch_product_validation_spec.rb
|
|
256
|
-
- spec/unit/headers_spec.rb
|
|
257
|
-
- spec/unit/opaque_id_spec.rb
|
|
258
|
-
- spec/unit/user_agent_spec.rb
|
|
259
|
-
- spec/unit/wrapper_gem_spec.rb
|
|
257
|
+
test_files: []
|
data/Gemfile
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# Licensed to Elasticsearch B.V. under one or more contributor
|
|
4
|
-
# license agreements. See the NOTICE file distributed with
|
|
5
|
-
# this work for additional information regarding copyright
|
|
6
|
-
# ownership. Elasticsearch B.V. licenses this file to you under
|
|
7
|
-
# the Apache License, Version 2.0 (the "License"); you may
|
|
8
|
-
# not use this file except in compliance with the License.
|
|
9
|
-
# You may obtain a copy of the License at
|
|
10
|
-
#
|
|
11
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
#
|
|
13
|
-
# Unless required by applicable law or agreed to in writing,
|
|
14
|
-
# software distributed under the License is distributed on an
|
|
15
|
-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
16
|
-
# KIND, either express or implied. See the License for the
|
|
17
|
-
# specific language governing permissions and limitations
|
|
18
|
-
# under the License.
|
|
19
|
-
|
|
20
|
-
source 'https://rubygems.org'
|
|
21
|
-
|
|
22
|
-
# Specify your gem's dependencies in elasticsearch.gemspec
|
|
23
|
-
gemspec
|
|
24
|
-
|
|
25
|
-
if File.exist? File.expand_path('../elasticsearch-api/elasticsearch-api.gemspec', __dir__)
|
|
26
|
-
gem 'elasticsearch-api', path: File.expand_path('../elasticsearch-api', __dir__), require: false
|
|
27
|
-
end
|
data/Rakefile
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
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
|
-
require 'bundler/gem_tasks'
|
|
19
|
-
|
|
20
|
-
task(:default) { system 'rake --tasks' }
|
|
21
|
-
|
|
22
|
-
desc 'Run unit tests'
|
|
23
|
-
task test: 'test:spec'
|
|
24
|
-
|
|
25
|
-
# ----- Test tasks ------------------------------------------------------------
|
|
26
|
-
require 'rspec/core/rake_task'
|
|
27
|
-
|
|
28
|
-
namespace :test do
|
|
29
|
-
desc 'Wait for Elasticsearch to be in a green state'
|
|
30
|
-
task :wait_for_green do
|
|
31
|
-
sh '../scripts/wait-cluster.sh'
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
RSpec::Core::RakeTask.new(:integration) do |t|
|
|
35
|
-
t.pattern = 'spec/integration/**{,/*/**}/*_spec.rb'
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
RSpec::Core::RakeTask.new(:unit) do |t|
|
|
39
|
-
t.pattern = 'spec/unit/**{,/*/**}/*_spec.rb'
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
desc 'Run unit and integration tests'
|
|
43
|
-
task :all do
|
|
44
|
-
Rake::Task['test:unit'].invoke
|
|
45
|
-
Rake::Task['test:integration'].invoke
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
# ----- Documentation tasks ---------------------------------------------------
|
|
50
|
-
|
|
51
|
-
require 'yard'
|
|
52
|
-
YARD::Rake::YardocTask.new(:doc) do |t|
|
|
53
|
-
t.options = %w| --embed-mixins --markup=markdown |
|
|
54
|
-
end
|