elasticsearch 8.12.2 → 8.14.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5241bcaae583bd2a3f2a333c2694de1b05af8428d572a74b127baa08f000a172
4
- data.tar.gz: 57ba5a1bd7d8f43d65671dd7adc9e90c4db1b056164f38a5a4bf7b979bb29631
3
+ metadata.gz: 829c510c4fb0664f58d4be87a7d0d8eed2906b68e659f63b33a7e082cba6c1ee
4
+ data.tar.gz: bafb973a40c4eda2a5de4fb0abe5a7f4308efbe8105f531545953a405d2cb83f
5
5
  SHA512:
6
- metadata.gz: 7190459564453bab3661d6e8528d8cd0ab612654846467fd9d2c81cc05dab49f36d04d57dc7ac2120cf3e5d49b1ed1b005f33c9a383f62c4451f60d5b93aa660
7
- data.tar.gz: '01921137542be51cd96dd1bd5edf0b5f65e1bdf457673236e62167a559bf9b64312bae6c15a69cfc97b468a5f02a1e8f05bf57801d19aeeb2b984dc1ab83d4ba'
6
+ metadata.gz: 4c98e9e0c6cc219b281da17019021ce7bd7e28120c9390b05dd71550bf2527c99570002f779f504f10820effe1fc2cd0b2824213bb445184fb7b77eabc69532b
7
+ data.tar.gz: 6178b702bd1077554debcf12783ffd1cda149c507c87284cbe60028a0f06fe0db8f2c140f3c29fd19fca23ec456012087ff25f6dcec34553e63d550146248ede
data/Gemfile CHANGED
@@ -29,3 +29,7 @@ end
29
29
  if ENV['TRANSPORT_VERSION'] == 'main'
30
30
  gem 'elastic-transport', git: 'https://github.com/elastic/elastic-transport-ruby.git', branch: 'main'
31
31
  end
32
+
33
+ if RUBY_VERSION >= '3.0'
34
+ gem 'opentelemetry-sdk', require: false
35
+ end
@@ -46,11 +46,11 @@ Gem::Specification.new do |s|
46
46
  s.required_ruby_version = '>= 2.5'
47
47
 
48
48
  s.add_dependency 'elastic-transport', '~> 8.3'
49
- s.add_dependency 'elasticsearch-api', '8.12.2'
50
-
49
+ s.add_dependency 'elasticsearch-api', '8.14.0'
50
+
51
51
  s.add_development_dependency 'base64'
52
52
  s.add_development_dependency 'bundler'
53
- s.add_development_dependency 'byebug' unless defined?(JRUBY_VERSION) || defined?(Rubinius)
53
+ s.add_development_dependency 'debug' unless defined?(JRUBY_VERSION)
54
54
  s.add_development_dependency 'pry'
55
55
  s.add_development_dependency 'rake'
56
56
  s.add_development_dependency 'require-prof' unless defined?(JRUBY_VERSION) || defined?(Rubinius)
@@ -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) { |items| ingest(items, params, &block) }
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
@@ -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
@@ -16,5 +16,5 @@
16
16
  # under the License.
17
17
 
18
18
  module Elasticsearch
19
- VERSION = '8.12.2'.freeze
19
+ VERSION = '8.14.0'.freeze
20
20
  end
data/lib/elasticsearch.rb CHANGED
@@ -60,10 +60,6 @@ module Elasticsearch
60
60
  elsif name == :perform_request
61
61
  # The signature for perform_request is:
62
62
  # method, path, params, body, headers, opts
63
- # The last arg is opts, which shouldn't be sent when `perform_request` is called
64
- # directly. Check if :endpoint is a key, which means it's the extra identifier
65
- # used for OpenTelemetry.
66
- args.pop if args[-1].is_a?(Hash) && args[-1][:endpoint]
67
63
  if (opaque_id = args[2]&.delete(:opaque_id))
68
64
  headers = args[4] || {}
69
65
  opaque_id = @opaque_id_prefix ? "#{@opaque_id_prefix}#{opaque_id}" : opaque_id
@@ -14,11 +14,11 @@
14
14
  # KIND, either express or implied. See the License for the
15
15
  # specific language governing permissions and limitations
16
16
  # under the License.
17
+ require 'spec_helper'
18
+
17
19
  ELASTICSEARCH_URL = ENV['TEST_ES_SERVER'] || "http://localhost:#{(ENV['PORT'] || 9200)}"
18
20
  raise URI::InvalidURIError unless ELASTICSEARCH_URL =~ /\A#{URI::DEFAULT_PARSER.make_regexp}\z/
19
21
 
20
- require 'spec_helper'
21
-
22
22
  context 'Elasticsearch client' do
23
23
  let(:client) do
24
24
  Elasticsearch::Client.new(host: ELASTICSEARCH_URL, user: 'elastic', password: 'changeme')
@@ -14,12 +14,13 @@
14
14
  # KIND, either express or implied. See the License for the
15
15
  # specific language governing permissions and limitations
16
16
  # under the License.
17
- ELASTICSEARCH_URL = ENV['TEST_ES_SERVER'] || "http://localhost:#{(ENV['PORT'] || 9200)}"
18
- raise URI::InvalidURIError unless ELASTICSEARCH_URL =~ /\A#{URI::DEFAULT_PARSER.make_regexp}\z/
19
17
 
20
18
  require 'spec_helper'
21
19
  require 'logger'
22
20
 
21
+ ELASTICSEARCH_URL = ENV['TEST_ES_SERVER'] || "http://localhost:#{(ENV['PORT'] || 9200)}"
22
+ raise URI::InvalidURIError unless ELASTICSEARCH_URL =~ /\A#{URI::DEFAULT_PARSER.make_regexp}\z/
23
+
23
24
  context 'Elasticsearch client' do
24
25
  let(:logger) { Logger.new($stderr) }
25
26
 
@@ -54,7 +55,7 @@ context 'Elasticsearch client' do
54
55
  end
55
56
 
56
57
  context 'Reports the right meta header' do
57
- it 'Reports es service name and gem versio' do
58
+ it 'Reports es service name and gem version' do
58
59
  headers = client.transport.connections.first.connection.headers
59
60
  version = Class.new.extend(Elastic::Transport::MetaHeader).send(:client_meta_version, Elasticsearch::VERSION)
60
61
  expect(headers['x-elastic-client-meta']).to match /^es=#{version}/
@@ -14,23 +14,14 @@
14
14
  # KIND, either express or implied. See the License for the
15
15
  # specific language governing permissions and limitations
16
16
  # under the License.
17
- ELASTICSEARCH_URL = ENV['TEST_ES_SERVER'] || "http://localhost:#{(ENV['PORT'] || 9200)}"
18
- raise URI::InvalidURIError unless ELASTICSEARCH_URL =~ /\A#{URI::DEFAULT_PARSER.make_regexp}\z/
19
-
17
+ require_relative 'helpers_spec_helper'
20
18
  require 'elasticsearch/helpers/bulk_helper'
21
- require 'spec_helper'
22
19
  require 'tempfile'
23
20
 
24
21
  context 'Elasticsearch client helpers' do
25
22
  context 'Bulk helper' do
26
- let(:client) do
27
- Elasticsearch::Client.new(
28
- host: ELASTICSEARCH_URL,
29
- user: 'elastic',
30
- password: 'changeme'
31
- )
32
- end
33
23
  let(:index) { 'bulk_animals' }
24
+ let(:index_slice) { 'bulk_animals_slice' }
34
25
  let(:params) { { refresh: 'wait_for' } }
35
26
  let(:bulk_helper) { Elasticsearch::Helpers::BulkHelper.new(client, index, params) }
36
27
  let(:docs) do
@@ -50,6 +41,7 @@ context 'Elasticsearch client helpers' do
50
41
 
51
42
  after do
52
43
  client.indices.delete(index: index, ignore: 404)
44
+ client.indices.delete(index: index_slice, ignore: 404)
53
45
  end
54
46
 
55
47
  it 'Ingests documents' do
@@ -86,10 +78,13 @@ context 'Elasticsearch client helpers' do
86
78
 
87
79
  it 'Ingests documents and yields response and docs' do
88
80
  slice = 2
81
+ bulk_helper = Elasticsearch::Helpers::BulkHelper.new(client, index_slice, params)
89
82
  response = bulk_helper.ingest(docs, {slice: slice}) do |response, docs|
90
83
  expect(response).to be_an_instance_of Elasticsearch::API::Response
91
84
  expect(docs.count).to eq slice
92
85
  end
86
+ response = client.search(index: index_slice, size: 200)
87
+ expect(response['hits']['hits'].map { |a| a['_source'].transform_keys(&:to_sym) }).to eq docs
93
88
  end
94
89
 
95
90
  context 'JSON File helper' do
@@ -0,0 +1,118 @@
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
+ require_relative 'helpers_spec_helper'
18
+ require 'elasticsearch/helpers/esql_helper'
19
+ require 'ipaddr'
20
+
21
+ context 'Elasticsearch client helpers' do
22
+ let(:index) { 'esql_helper_test' }
23
+ let(:body) { { size: 12, query: { match_all: {} } } }
24
+ let(:esql_helper) { Elasticsearch::Helpers::ESQLHelper }
25
+ let(:query) do
26
+ <<~ESQL
27
+ FROM #{index}
28
+ | EVAL duration_ms = ROUND(event.duration / 1000000.0, 1)
29
+ ESQL
30
+ end
31
+
32
+ before do
33
+ client.indices.create(
34
+ index: index,
35
+ body: {
36
+ mappings: {
37
+ properties: { 'client.ip' => { type: 'ip' }, message: { type: 'keyword' } }
38
+ }
39
+ }
40
+ )
41
+ client.bulk(
42
+ index: index,
43
+ body: [
44
+ {'index': {}},
45
+ {'@timestamp' => '2023-10-23T12:15:03.360Z', 'client.ip' => '172.21.2.162', message: 'Connected to 10.1.0.3', 'event.duration' => 3450233},
46
+ {'index': {}},
47
+ {'@timestamp' => '2023-10-23T12:27:28.948Z', 'client.ip' => '172.21.2.113', message: 'Connected to 10.1.0.2', 'event.duration' => 2764889},
48
+ {'index': {}},
49
+ {'@timestamp' => '2023-10-23T13:33:34.937Z', 'client.ip' => '172.21.0.5', message: 'Disconnected', 'event.duration' => 1232382},
50
+ {'index': {}},
51
+ {'@timestamp' => '2023-10-23T13:51:54.732Z', 'client.ip' => '172.21.3.15', message: 'Connection error', 'event.duration' => 725448},
52
+ {'index': {}},
53
+ {'@timestamp' => '2023-10-23T13:52:55.015Z', 'client.ip' => '172.21.3.15', message: 'Connection error', 'event.duration' => 8268153},
54
+ {'index': {}},
55
+ {'@timestamp' => '2023-10-23T13:53:55.832Z', 'client.ip' => '172.21.3.15', message: 'Connection error', 'event.duration' => 5033755},
56
+ {'index': {}},
57
+ {'@timestamp' => '2023-10-23T13:55:01.543Z', 'client.ip' => '172.21.3.15', message: 'Connected to 10.1.0.1', 'event.duration' => 1756467}
58
+ ],
59
+ refresh: true
60
+ )
61
+ end
62
+
63
+ after do
64
+ client.indices.delete(index: index)
65
+ end
66
+
67
+ it 'returns an ESQL response as a relational key/value object' do
68
+ response = esql_helper.query(client, query)
69
+ expect(response.count).to eq 7
70
+ expect(response.first.keys).to eq ['duration_ms', 'message', 'event.duration', 'client.ip', '@timestamp']
71
+ response.each do |r|
72
+ expect(r['@timestamp']).to be_a String
73
+ expect(r['client.ip']).to be_a String
74
+ expect(r['message']).to be_a String
75
+ expect(r['event.duration']).to be_a Integer
76
+ end
77
+ end
78
+
79
+ it 'parses iterated objects when procs are passed in' do
80
+ parser = {
81
+ '@timestamp' => Proc.new { |t| DateTime.parse(t) },
82
+ 'client.ip' => Proc.new { |i| IPAddr.new(i) },
83
+ 'event.duration' => Proc.new { |d| d.to_s }
84
+ }
85
+ response = esql_helper.query(client, query, parser: parser)
86
+ response.each do |r|
87
+ expect(r['@timestamp']).to be_a DateTime
88
+ expect(r['client.ip']).to be_a IPAddr
89
+ expect(r['message']).to be_a String
90
+ expect(r['event.duration']).to be_a String
91
+ end
92
+ end
93
+
94
+ it 'parser does not error when value is nil, leaves nil' do
95
+ client.index(
96
+ index: index,
97
+ body: {
98
+ '@timestamp' => nil,
99
+ 'client.ip' => nil,
100
+ message: 'Connected to 10.1.0.1',
101
+ 'event.duration' => 1756465
102
+ },
103
+ refresh: true
104
+ )
105
+ parser = {
106
+ '@timestamp' => Proc.new { |t| DateTime.parse(t) },
107
+ 'client.ip' => Proc.new { |i| IPAddr.new(i) },
108
+ 'event.duration' => Proc.new { |d| d.to_s }
109
+ }
110
+ response = esql_helper.query(client, query, parser: parser)
111
+ response.each do |r|
112
+ expect [DateTime, NilClass].include?(r['@timestamp'].class)
113
+ expect [IPAddr, NilClass].include?(r['client.ip'].class)
114
+ expect(r['message']).to be_a String
115
+ expect(r['event.duration']).to be_a String
116
+ end
117
+ end
118
+ end
@@ -0,0 +1,29 @@
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 'spec_helper'
19
+
20
+ ELASTICSEARCH_URL = ENV['TEST_ES_SERVER'] || "http://localhost:#{(ENV['PORT'] || 9200)}"
21
+ raise URI::InvalidURIError unless ELASTICSEARCH_URL =~ /\A#{URI::DEFAULT_PARSER.make_regexp}\z/
22
+
23
+ def client
24
+ @client ||= Elasticsearch::Client.new(
25
+ host: ELASTICSEARCH_URL,
26
+ user: 'elastic',
27
+ password: 'changeme'
28
+ )
29
+ end
@@ -14,20 +14,10 @@
14
14
  # KIND, either express or implied. See the License for the
15
15
  # specific language governing permissions and limitations
16
16
  # under the License.
17
- ELASTICSEARCH_URL = ENV['TEST_ES_SERVER'] || "http://localhost:#{(ENV['PORT'] || 9200)}"
18
- raise URI::InvalidURIError unless ELASTICSEARCH_URL =~ /\A#{URI::DEFAULT_PARSER.make_regexp}\z/
19
-
20
- require 'spec_helper'
17
+ require_relative 'helpers_spec_helper'
21
18
  require 'elasticsearch/helpers/scroll_helper'
22
19
 
23
20
  context 'Elasticsearch client helpers' do
24
- let(:client) do
25
- Elasticsearch::Client.new(
26
- host: ELASTICSEARCH_URL,
27
- user: 'elastic',
28
- password: 'changeme'
29
- )
30
- end
31
21
  let(:index) { 'books' }
32
22
  let(:body) { { size: 12, query: { match_all: {} } } }
33
23
  let(:scroll_helper) { Elasticsearch::Helpers::ScrollHelper.new(client, index, body) }
@@ -0,0 +1,55 @@
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
+ if ENV['TEST_WITH_OTEL'] == 'true'
19
+ ELASTICSEARCH_URL = ENV['TEST_ES_SERVER'] || "http://localhost:#{(ENV['PORT'] || 9200)}"
20
+ raise URI::InvalidURIError unless ELASTICSEARCH_URL =~ /\A#{URI::DEFAULT_PARSER.make_regexp}\z/
21
+
22
+ require 'spec_helper'
23
+
24
+ context 'OpenTelemetry' do
25
+ let(:exporter) { EXPORTER }
26
+ before { exporter.reset }
27
+ after { exporter.reset }
28
+ let(:span) { exporter.finished_spans[0] }
29
+
30
+ let(:client) do
31
+ Elasticsearch::Client.new(
32
+ host: ELASTICSEARCH_URL,
33
+ user: 'elastic',
34
+ password: 'changeme'
35
+ )
36
+ end
37
+
38
+ after do
39
+ client.delete(index: 'myindex', id: 1); rescue
40
+ end
41
+
42
+ context 'when a request is instrumented' do
43
+ it 'sets the span name to the endpoint id' do
44
+ client.search(body: { query: { match: {a: 1} } })
45
+ expect(span.name).to eq 'search'
46
+ end
47
+
48
+ it 'sets the path parts' do
49
+ client.index(index: 'myindex', id: 1, body: { title: 'Test' })
50
+ expect(span.attributes['db.elasticsearch.path_parts.index']).to eq 'myindex'
51
+ expect(span.attributes['db.elasticsearch.path_parts.id']).to eq 1
52
+ end
53
+ end
54
+ end
55
+ end
data/spec/spec_helper.rb CHANGED
@@ -29,3 +29,15 @@ end
29
29
  def jruby?
30
30
  defined?(JRUBY_VERSION)
31
31
  end
32
+
33
+ if ENV['TEST_WITH_OTEL'] == 'true'
34
+ require 'opentelemetry-sdk'
35
+ EXPORTER = OpenTelemetry::SDK::Trace::Export::InMemorySpanExporter.new
36
+ span_processor = OpenTelemetry::SDK::Trace::Export::SimpleSpanProcessor.new(EXPORTER)
37
+
38
+ OpenTelemetry::SDK.configure do |c|
39
+ c.error_handler = ->(exception:, message:) { raise(exception || message) }
40
+ c.logger = Logger.new($stderr, level: ENV.fetch('OTEL_LOG_LEVEL', 'fatal').to_sym)
41
+ c.add_span_processor span_processor
42
+ end
43
+ end
@@ -29,7 +29,7 @@ describe Elasticsearch::Client do
29
29
  it 'uses x-opaque-id on a request' do
30
30
  client.search(opaque_id: '12345')
31
31
  expect(transport).to have_received(:perform_request)
32
- .with('GET', '_search', {}, nil, { 'X-Opaque-Id' => '12345' })
32
+ .with('GET', '_search', {}, nil, { 'X-Opaque-Id' => '12345' }, {:endpoint=>"search"})
33
33
  end
34
34
  end
35
35
 
@@ -42,7 +42,7 @@ describe Elasticsearch::Client do
42
42
  it 'uses x-opaque-id on a request' do
43
43
  expect { client.search(opaque_id: '12345') }.not_to raise_error
44
44
  expect(transport).to have_received(:perform_request)
45
- .with('GET', '_search', {}, nil, { 'X-Opaque-Id' => 'elastic_cloud12345' })
45
+ .with('GET', '_search', {}, nil, { 'X-Opaque-Id' => 'elastic_cloud12345' }, {:endpoint=>"search"})
46
46
  end
47
47
  end
48
48
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elasticsearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.12.2
4
+ version: 8.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic Client Library Maintainers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-06 00:00:00.000000000 Z
11
+ date: 2024-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: elastic-transport
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 8.12.2
33
+ version: 8.14.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 8.12.2
40
+ version: 8.14.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: base64
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -67,7 +67,7 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: byebug
70
+ name: debug
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
@@ -214,12 +214,16 @@ files:
214
214
  - lib/elasticsearch-ruby.rb
215
215
  - lib/elasticsearch.rb
216
216
  - lib/elasticsearch/helpers/bulk_helper.rb
217
+ - lib/elasticsearch/helpers/esql_helper.rb
217
218
  - lib/elasticsearch/helpers/scroll_helper.rb
218
219
  - lib/elasticsearch/version.rb
219
220
  - spec/integration/characters_escaping_spec.rb
220
221
  - spec/integration/client_integration_spec.rb
221
222
  - spec/integration/helpers/bulk_helper_spec.rb
223
+ - spec/integration/helpers/esql_helper_spec.rb
224
+ - spec/integration/helpers/helpers_spec_helper.rb
222
225
  - spec/integration/helpers/scroll_helper_spec.rb
226
+ - spec/integration/opentelemetry_spec.rb
223
227
  - spec/spec_helper.rb
224
228
  - spec/unit/api_key_spec.rb
225
229
  - spec/unit/cloud_credentials_spec.rb
@@ -253,7 +257,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
253
257
  - !ruby/object:Gem::Version
254
258
  version: '0'
255
259
  requirements: []
256
- rubygems_version: 3.5.3
260
+ rubygems_version: 3.5.9
257
261
  signing_key:
258
262
  specification_version: 4
259
263
  summary: Ruby integrations for Elasticsearch
@@ -261,7 +265,10 @@ test_files:
261
265
  - spec/integration/characters_escaping_spec.rb
262
266
  - spec/integration/client_integration_spec.rb
263
267
  - spec/integration/helpers/bulk_helper_spec.rb
268
+ - spec/integration/helpers/esql_helper_spec.rb
269
+ - spec/integration/helpers/helpers_spec_helper.rb
264
270
  - spec/integration/helpers/scroll_helper_spec.rb
271
+ - spec/integration/opentelemetry_spec.rb
265
272
  - spec/spec_helper.rb
266
273
  - spec/unit/api_key_spec.rb
267
274
  - spec/unit/cloud_credentials_spec.rb