elastic-enterprise-search 8.4.0 → 8.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 29385166cdc5e9a328cf67da13cab2a4aa66a99319cea68f18589dffe02aa10f
4
- data.tar.gz: '08f62bbcfd1b0b86f75642410aeb6b13a6af5e2342d6570a1ff503fc204d0db3'
3
+ metadata.gz: 370baa568c7b78d3fa58a0c322732c106163b3f91845841287b968966ca70717
4
+ data.tar.gz: 76108e767bc9e72f6ca6c981629f69a8c9e99106b07dc460761aaf089be4c86a
5
5
  SHA512:
6
- metadata.gz: 19cad7d9137c49c057702b95628eab683f0e5797e56245569e92b36edaf4824e26ebeeb40793f97b634e037b948e6e69df3d1217a9e8affe52dd1a1596282c2d
7
- data.tar.gz: ab239465521ca6f25d5e4ca3e32e8f74bab95420123a32ae73e8bcecd29a3f23765b30fa6dbd7ab0c3c4d485e95d6923f3442c0d555a5f684fb8413ae962ec3a
6
+ metadata.gz: 17ebc4758f08ae8a5e198d02fa45016525f080d8cc357b9a3b5ad82b2b208c89e5534e05f61e784cccc4ab4b9d30c79e6737845f52cd25bc1741ceff95bc893e
7
+ data.tar.gz: 0252bf54a1828983f1a8daac3ae4fb123a814aaa4f9d195df7284cea265542cb370242c71dd5fb9c2832f81650e5b17f3b58da8ae585fc08e5e7aff03881b7a3
@@ -1,12 +1,12 @@
1
1
  ---
2
2
  - job:
3
- name: elastic+enterprise-search-ruby+8.0
4
- display-name: 'elastic / enterprise-search-ruby # 8.0'
5
- description: Testing the enterprise-search-ruby 8.0 branch.
3
+ name: elastic+enterprise-search-ruby+8.4
4
+ display-name: 'elastic / enterprise-search-ruby # 8.4'
5
+ description: Testing the enterprise-search-ruby 8.4 branch.
6
6
  junit_results: "*-junit.xml"
7
7
  parameters:
8
8
  - string:
9
9
  name: branch_specifier
10
- default: refs/heads/8.0
10
+ default: refs/heads/8.4
11
11
  description: the Git branch specifier to build (<branchName>, <tagName>,
12
12
  <commitId>, etc.)
data/.ci/test-matrix.yml CHANGED
@@ -5,7 +5,7 @@ RUBY_VERSION:
5
5
  - 2.7
6
6
 
7
7
  STACK_VERSION:
8
- - 8.4.0-SNAPSHOT
8
+ - 8.5.0-SNAPSHOT
9
9
 
10
10
  SERVICE:
11
11
  - appsearch
@@ -11,5 +11,5 @@ jobs:
11
11
  ruby-version: 2.7
12
12
  - name: Run Rubocop
13
13
  run: |
14
- bundle install
15
- bundle exec rubocop
14
+ gem install rubocop
15
+ rubocop
@@ -16,6 +16,8 @@ jobs:
16
16
  ruby-version: ${{ matrix.ruby }}
17
17
  - name: Build and test with Rake
18
18
  run: |
19
+ sudo apt-get update
20
+ sudo apt-get install libcurl4-openssl-dev
19
21
  ruby -v
20
22
  bundle install
21
23
  bundle exec rake spec:client
@@ -0,0 +1,40 @@
1
+ [[release_notes_85]]
2
+ === 8.5 Release notes
3
+
4
+ [discrete]
5
+ [[release_notes_850]]
6
+ === 8.5.0 Release notes
7
+
8
+ ==== Client
9
+ - Updates dependency on `elastic-transport`. With the latest release of `elastic-transport` - `v8.1.0` - this gem now supports Faraday v2. When you upgrade your gems, `8.1.0` will be installed. This supports both Faraday v1 and Faraday v2. The main change on dependencies when using Faraday v2 is all adapters, except for the default `net_http` one, have been moved out of Faraday into separate gems. This means if you're not using the default adapter and you migrate to Faraday v2, you'll need to add the adapter gems to your Gemfile.
10
+
11
+ These are the gems required for the different adapters with Faraday 2, instead of the libraries on which they were based:
12
+
13
+ [source,rb]
14
+ ----------------------------
15
+ # HTTPCLient
16
+ gem 'faraday-httpclient'
17
+ # NetHTTPPersistent
18
+ gem 'faraday-net_http_persistent'
19
+ # Patron
20
+ gem 'faraday-patron'
21
+ # Typhoeus
22
+ gem 'faraday-typhoeus'
23
+ ----------------------------
24
+
25
+ Things should work fine if you migrate to Faraday 2 as long as you include the adapter (unless you're using the default one `net-http`), but worst case scenario, you can always lock the version of Faraday in your project to 1.x:
26
+ `gem 'faraday', '~> 1'`
27
+
28
+ *Troubleshooting*
29
+
30
+ If you see a message like:
31
+ `:adapter is not registered on Faraday::Adapter (Faraday::Error)`
32
+ Then you probably need to include the adapter library in your gemfile and require it.
33
+
34
+ Please https://github.com/elastic/enterprise-search-ruby/issues[submit an issue] if you encounter any problems.
35
+
36
+ [discrete]
37
+ ==== App Search
38
+
39
+ - Adds `precision_enabled` (Boolean) to `put_search_settings`. See https://www.elastic.co/guide/en/app-search/current/search-settings.html#search-settings-update[here] for more information.
40
+ - `search_es_search` and `search_explain` changed the path to `api/as/v1` instead of `v0` and are now GA with version `8.5` of the stack.
@@ -4,6 +4,7 @@
4
4
  [discrete]
5
5
  === 8.x
6
6
 
7
+ * <<release_notes_85, 8.5.0 Release Notes>>
7
8
  * <<release_notes_84, 8.4.0 Release Notes>>
8
9
  * <<release_notes_83, 8.3.0 Release Notes>>
9
10
  * <<release_notes_82, 8.2.0 Release Notes>>
@@ -22,6 +23,7 @@
22
23
  * <<release_notes_711, 7.11.0 Release Notes>>
23
24
  * <<release_notes_710, 7.10.0.beta.1 Release Notes>>
24
25
 
26
+ include::85.asciidoc[]
25
27
  include::84.asciidoc[]
26
28
  include::83.asciidoc[]
27
29
  include::82.asciidoc[]
@@ -47,7 +47,7 @@ Gem::Specification.new do |s|
47
47
  s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
48
48
  s.require_paths = ['lib']
49
49
 
50
- s.add_dependency 'elastic-transport', '~> 8'
50
+ s.add_dependency 'elastic-transport', '~> 8.1'
51
51
  s.add_runtime_dependency 'jwt', '>= 1.5', '< 3.0'
52
52
  s.add_development_dependency 'awesome_print'
53
53
  s.add_development_dependency 'byebug' unless defined?(JRUBY_VERSION)
@@ -56,5 +56,10 @@ Gem::Specification.new do |s|
56
56
  s.add_development_dependency 'rubocop', '~> 1'
57
57
  s.add_development_dependency 'vcr', '~> 3.0.3'
58
58
  s.add_development_dependency 'webmock'
59
+ # Adapters
60
+ s.add_development_dependency 'faraday-httpclient'
61
+ s.add_development_dependency 'faraday-net_http_persistent'
62
+ s.add_development_dependency 'faraday-patron' unless defined? JRUBY_VERSION
63
+ s.add_development_dependency 'faraday-typhoeus'
59
64
  end
60
65
  # rubocop:enable Metrics/BlockLength
@@ -31,6 +31,7 @@ module Elastic
31
31
  # @option body :search_fields
32
32
  # @option body :result_fields
33
33
  # @option body [integer] :precision
34
+ # @option body [boolean] :precision_enabled
34
35
  # @option arguments [Hash] :headers optional HTTP headers to send with the request
35
36
  #
36
37
  # @see https://www.elastic.co/guide/en/app-search/current/search-settings.html#search-settings-update
@@ -27,6 +27,7 @@ module Elastic
27
27
  # @param [String] engine_name Name of the engine (*Required*)
28
28
  # @param [Hash] arguments endpoint arguments
29
29
  # @option arguments [Hash] :body Query parameters to be passed to Elasticsearch _search API
30
+ # @option arguments [Object] :es_search_query_params Query parameters to be passed to Elasticsearch _search API
30
31
  # @option arguments [Hash] :headers optional HTTP headers to send with the request
31
32
  # @option headers [String] :X-Enterprise-Search-Analytics The search query associated with this request when recording search analytics
32
33
  # @option headers [String] :X-Enterprise-Search-Analytics-Tags Analytics tags to be applied with this search request
@@ -40,7 +41,7 @@ module Elastic
40
41
  headers = arguments.delete(:headers) || {}
41
42
  request(
42
43
  :post,
43
- "api/as/v0/engines/#{engine_name}/elasticsearch/_search/",
44
+ "api/as/v1/engines/#{engine_name}/elasticsearch/_search/",
44
45
  arguments,
45
46
  body,
46
47
  headers
@@ -49,7 +49,7 @@ module Elastic
49
49
  headers = arguments.delete(:headers) || {}
50
50
  request(
51
51
  :post,
52
- "api/as/v0/engines/#{engine_name}/search_explain/",
52
+ "api/as/v1/engines/#{engine_name}/search_explain/",
53
53
  arguments,
54
54
  body,
55
55
  headers
@@ -19,6 +19,6 @@
19
19
 
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
- VERSION = '8.4.0'
22
+ VERSION = '8.5.0'
23
23
  end
24
24
  end
@@ -86,32 +86,5 @@ describe Elastic::EnterpriseSearch::AppSearch::Client do
86
86
  end
87
87
  end
88
88
 
89
- context 'adapters' do
90
- let(:client) { described_class.new }
91
- let(:adapter) { client.transport.transport.connections.all.first.connection.builder.adapter }
92
-
93
- context 'when no adapter is specified' do
94
- it 'uses Faraday NetHttp' do
95
- expect(adapter).to eq Faraday::Adapter::NetHttp
96
- end
97
- end
98
-
99
- context 'when the adapter is patron' do
100
- let(:client) { described_class.new(adapter: :patron) }
101
-
102
- it 'uses Faraday with the adapter' do
103
- expect(adapter).to eq Faraday::Adapter::Patron
104
- end
105
- end
106
-
107
- unless defined?(JRUBY_VERSION)
108
- context 'when the adapter is typhoeus' do
109
- let(:client) { described_class.new(adapter: :patron) }
110
-
111
- it 'uses Faraday with the adapter' do
112
- expect(adapter).to eq Faraday::Adapter::Patron
113
- end
114
- end
115
- end
116
- end
89
+ include_examples 'adapters compatibility'
117
90
  end
@@ -104,32 +104,5 @@ describe Elastic::EnterpriseSearch::Client do
104
104
  end
105
105
  end
106
106
 
107
- context 'adapters' do
108
- let(:client) { described_class.new }
109
- let(:adapter) { client.transport.transport.connections.all.first.connection.builder.adapter }
110
-
111
- context 'when no adapter is specified' do
112
- it 'uses Faraday NetHttp' do
113
- expect(adapter).to eq Faraday::Adapter::NetHttp
114
- end
115
- end
116
-
117
- context 'when the adapter is patron' do
118
- let(:client) { described_class.new(adapter: :patron) }
119
-
120
- it 'uses Faraday with the adapter' do
121
- expect(adapter).to eq Faraday::Adapter::Patron
122
- end
123
- end
124
-
125
- unless defined?(JRUBY_VERSION)
126
- context 'when the adapter is typhoeus' do
127
- let(:client) { described_class.new(adapter: :patron) }
128
-
129
- it 'uses Faraday with the adapter' do
130
- expect(adapter).to eq Faraday::Adapter::Patron
131
- end
132
- end
133
- end
134
- end
107
+ include_examples 'adapters compatibility'
135
108
  end
data/spec/spec_helper.rb CHANGED
@@ -39,3 +39,37 @@ RSpec.configure do |config|
39
39
  c.allow_http_connections_when_no_cassette = true
40
40
  end
41
41
  end
42
+
43
+ def is_faraday2?
44
+ return false unless defined?(Faraday::VERSION)
45
+
46
+ Gem::Version.new(Faraday::VERSION) >= Gem::Version.new(2)
47
+ end
48
+
49
+ def hide_constants
50
+ hide_const('Faraday::Adapter::Patron')
51
+ hide_const('Patron')
52
+ hide_const('Faraday::Adapter::Typhoeus')
53
+ hide_const('Typhoeus')
54
+ end
55
+
56
+ shared_examples 'adapters compatibility' do
57
+ let(:transport_client) { instance_double(Elastic::Transport::Client) }
58
+ let(:adapter) { client.transport.transport.connections.all.first.connection.builder.adapter }
59
+ let(:client) { described_class.new }
60
+
61
+ context 'default ' do
62
+ it 'uses default NetHttp Faraday adapter' do
63
+ hide_constants
64
+ expect(adapter).to eq Faraday::Adapter::NetHttp
65
+ end
66
+ end
67
+
68
+ context 'selecting adapter' do
69
+ it 'uses Typhoeus when specified' do
70
+ allow(Elastic::Transport::Client).to receive(:new).and_return({})
71
+ described_class.new(adapter: :typhoeus)
72
+ expect(Elastic::Transport::Client).to have_received(:new).with(hash_including(adapter: :typhoeus))
73
+ end
74
+ end
75
+ end
@@ -105,32 +105,5 @@ describe Elastic::EnterpriseSearch::WorkplaceSearch::Client do
105
105
  end
106
106
  end
107
107
 
108
- context 'adapters' do
109
- let(:client) { described_class.new }
110
- let(:adapter) { client.transport.transport.connections.all.first.connection.builder.adapter }
111
-
112
- context 'when no adapter is specified' do
113
- it 'uses Faraday NetHttp' do
114
- expect(adapter).to eq Faraday::Adapter::NetHttp
115
- end
116
- end
117
-
118
- context 'when the adapter is patron' do
119
- let(:client) { described_class.new(adapter: :patron) }
120
-
121
- it 'uses Faraday with the adapter' do
122
- expect(adapter).to eq Faraday::Adapter::Patron
123
- end
124
- end
125
-
126
- unless defined?(JRUBY_VERSION)
127
- context 'when the adapter is typhoeus' do
128
- let(:client) { described_class.new(adapter: :patron) }
129
-
130
- it 'uses Faraday with the adapter' do
131
- expect(adapter).to eq Faraday::Adapter::Patron
132
- end
133
- end
134
- end
135
- end
108
+ include_examples 'adapters compatibility'
136
109
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elastic-enterprise-search
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.4.0
4
+ version: 8.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fernando Briano
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-24 00:00:00.000000000 Z
11
+ date: 2022-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: elastic-transport
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '8'
19
+ version: '8.1'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '8'
26
+ version: '8.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: jwt
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -142,6 +142,62 @@ dependencies:
142
142
  - - ">="
143
143
  - !ruby/object:Gem::Version
144
144
  version: '0'
145
+ - !ruby/object:Gem::Dependency
146
+ name: faraday-httpclient
147
+ requirement: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - ">="
150
+ - !ruby/object:Gem::Version
151
+ version: '0'
152
+ type: :development
153
+ prerelease: false
154
+ version_requirements: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - ">="
157
+ - !ruby/object:Gem::Version
158
+ version: '0'
159
+ - !ruby/object:Gem::Dependency
160
+ name: faraday-net_http_persistent
161
+ requirement: !ruby/object:Gem::Requirement
162
+ requirements:
163
+ - - ">="
164
+ - !ruby/object:Gem::Version
165
+ version: '0'
166
+ type: :development
167
+ prerelease: false
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ requirements:
170
+ - - ">="
171
+ - !ruby/object:Gem::Version
172
+ version: '0'
173
+ - !ruby/object:Gem::Dependency
174
+ name: faraday-patron
175
+ requirement: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - ">="
178
+ - !ruby/object:Gem::Version
179
+ version: '0'
180
+ type: :development
181
+ prerelease: false
182
+ version_requirements: !ruby/object:Gem::Requirement
183
+ requirements:
184
+ - - ">="
185
+ - !ruby/object:Gem::Version
186
+ version: '0'
187
+ - !ruby/object:Gem::Dependency
188
+ name: faraday-typhoeus
189
+ requirement: !ruby/object:Gem::Requirement
190
+ requirements:
191
+ - - ">="
192
+ - !ruby/object:Gem::Version
193
+ version: '0'
194
+ type: :development
195
+ prerelease: false
196
+ version_requirements: !ruby/object:Gem::Requirement
197
+ requirements:
198
+ - - ">="
199
+ - !ruby/object:Gem::Version
200
+ version: '0'
145
201
  description: 'Official API client for Elastic Enterprise Search APIs.
146
202
 
147
203
  '
@@ -165,10 +221,9 @@ files:
165
221
  - ".ci/functions/wait-for-container.sh"
166
222
  - ".ci/jobs/defaults.yml"
167
223
  - ".ci/jobs/elastic+enterprise-search-ruby+7.17.yml"
168
- - ".ci/jobs/elastic+enterprise-search-ruby+8.0.yml"
169
- - ".ci/jobs/elastic+enterprise-search-ruby+8.1.yml"
170
224
  - ".ci/jobs/elastic+enterprise-search-ruby+8.2.yml"
171
225
  - ".ci/jobs/elastic+enterprise-search-ruby+8.3.yml"
226
+ - ".ci/jobs/elastic+enterprise-search-ruby+8.4.yml"
172
227
  - ".ci/jobs/elastic+enterprise-search-ruby+main.yml"
173
228
  - ".ci/jobs/elastic+enterprise-search-ruby+pull-request.yml"
174
229
  - ".ci/make.sh"
@@ -213,6 +268,7 @@ files:
213
268
  - docs/guide/release_notes/82.asciidoc
214
269
  - docs/guide/release_notes/83.asciidoc
215
270
  - docs/guide/release_notes/84.asciidoc
271
+ - docs/guide/release_notes/85.asciidoc
216
272
  - docs/guide/release_notes/index.asciidoc
217
273
  - docs/guide/workplace-search-api.asciidoc
218
274
  - elastic-enterprise-search.gemspec
@@ -1,12 +0,0 @@
1
- ---
2
- - job:
3
- name: elastic+enterprise-search-ruby+8.1
4
- display-name: 'elastic / enterprise-search-ruby # 8.1'
5
- description: Testing the enterprise-search-ruby 8.1 branch.
6
- junit_results: "*-junit.xml"
7
- parameters:
8
- - string:
9
- name: branch_specifier
10
- default: refs/heads/8.1
11
- description: the Git branch specifier to build (&lt;branchName&gt;, &lt;tagName&gt;,
12
- &lt;commitId&gt;, etc.)