es-elasticity 1.0.0 → 1.1.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: a71a1d59a0baa8af334a40cc3b38c8210b3e962e9daa0a899820bad2d1a2598e
4
- data.tar.gz: 2c7032d5508738f6588c252e126d5213453204359f2bf8cae242359c1a36e7ec
3
+ metadata.gz: 199962dd3d7976f5fcefe948bed04e6c568d332c3ac6a9ecd1e5c89893a5f01a
4
+ data.tar.gz: e8a326cfa07858cb01a82ff47e735787fa517e36bebb1606d9c2965ce5b0966d
5
5
  SHA512:
6
- metadata.gz: 5892bd0e785358bf7d8bd9b3946d3c8561549aad4c95adde310412bddf340e06413db60aa2cd5ebcc725b7cef1bb946d677918de4d323d1b0ca2f4d6873a329e
7
- data.tar.gz: 53478a2feb259f44b52ab87738abbb670a292efa3782e9a41302f0a015e2a1c1d08b9e3fe73c0e67075f9d78f0daab17aa7ad0e37b4e91b8bf4945b4b0b86e1a
6
+ metadata.gz: ad6cd3a7af2e3f74f9f7f66670071400ae03576125f525a7c54c70a85a56507b7a8b2dce5bd7140a19c21c82e301ed64ee5b6e10421c703701b549a3a64c6647
7
+ data.tar.gz: 8a88dbdf4c9c0809e31c3aab5c6b1f315d47e21edc286540b30c1891371a0176fee5a6943c2a7e95f60c14da350a50a1d8ba272eaf70fcb34a122fac3a588aba
data/.circleci/config.yml CHANGED
@@ -19,7 +19,7 @@ executors:
19
19
  - image: cimg/ruby:2.7
20
20
  environment:
21
21
  BUNDLE_VERSION: '~> 2.3.4'
22
- - image: docker.elastic.co/elasticsearch/elasticsearch:7.17.3
22
+ - image: docker.elastic.co/elasticsearch/elasticsearch:8.6.2
23
23
  environment:
24
24
  - 'ES_JAVA_OPTS=-Xms512m -Xmx512m'
25
25
  - discovery.type=single-node
@@ -30,7 +30,7 @@ executors:
30
30
  - image: cimg/ruby:3.0
31
31
  environment:
32
32
  BUNDLE_VERSION: '~> 2.3.4'
33
- - image: docker.elastic.co/elasticsearch/elasticsearch:7.17.3
33
+ - image: docker.elastic.co/elasticsearch/elasticsearch:8.6.2
34
34
  environment:
35
35
  - 'ES_JAVA_OPTS=-Xms512m -Xmx512m'
36
36
  - discovery.type=single-node
@@ -42,7 +42,7 @@ executors:
42
42
  - image: cimg/ruby:3.1
43
43
  environment:
44
44
  BUNDLE_VERSION: '~> 2.3.4'
45
- - image: docker.elastic.co/elasticsearch/elasticsearch:7.17.3
45
+ - image: docker.elastic.co/elasticsearch/elasticsearch:8.6.2
46
46
  environment:
47
47
  - 'ES_JAVA_OPTS=-Xms512m -Xmx512m'
48
48
  - discovery.type=single-node
data/CHANGELOG.md CHANGED
@@ -4,7 +4,13 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
- ## [Unreleased]
7
+ ## [1.1.0] - 2023-05-02
8
+ ### Changed
9
+ - Updated the max elasticsearch dependency version to < 8.7
10
+
11
+ ## [1.0.1] - 2022-08-16
12
+ ### Changed
13
+ - Revert the additional `frozen_string_literal` updates in 1.0.0 due to some issues with some classes. We'll update these in a separate release to isolate the problem.
8
14
 
9
15
  ## [1.0.0] - 2022-08-09
10
16
  ### Changed
data/Gemfile.lock CHANGED
@@ -1,21 +1,22 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- es-elasticity (1.0.0)
4
+ es-elasticity (1.1.0)
5
5
  activemodel (>= 5.2.0, < 7.1)
6
6
  activerecord (>= 5.2.0, < 7.1)
7
7
  activesupport (>= 5.2.0, < 7.1)
8
- elasticsearch (>= 7, < 8)
8
+ elastic-transport (>= 8.0, < 8.7)
9
+ elasticsearch (>= 7, < 8.7)
9
10
 
10
11
  GEM
11
12
  remote: https://artifacts.dox.support/repository/gems/
12
13
  specs:
13
- activemodel (7.0.3.1)
14
- activesupport (= 7.0.3.1)
15
- activerecord (7.0.3.1)
16
- activemodel (= 7.0.3.1)
17
- activesupport (= 7.0.3.1)
18
- activesupport (7.0.3.1)
14
+ activemodel (7.0.4.3)
15
+ activesupport (= 7.0.4.3)
16
+ activerecord (7.0.4.3)
17
+ activemodel (= 7.0.4.3)
18
+ activesupport (= 7.0.4.3)
19
+ activesupport (7.0.4.3)
19
20
  concurrent-ruby (~> 1.0, >= 1.0.2)
20
21
  i18n (>= 1.6, < 2)
21
22
  minitest (>= 5.1)
@@ -24,45 +25,25 @@ GEM
24
25
  codeclimate-test-reporter (1.0.9)
25
26
  simplecov (<= 0.13)
26
27
  coderay (1.1.2)
27
- concurrent-ruby (1.1.10)
28
+ concurrent-ruby (1.2.2)
28
29
  diff-lcs (1.3)
29
- elasticsearch (7.17.1)
30
- elasticsearch-api (= 7.17.1)
31
- elasticsearch-transport (= 7.17.1)
32
- elasticsearch-api (7.17.1)
30
+ elastic-transport (8.2.1)
31
+ faraday (< 3)
33
32
  multi_json
34
- elasticsearch-transport (7.17.1)
35
- faraday (~> 1)
33
+ elasticsearch (8.6.0)
34
+ elastic-transport (~> 8)
35
+ elasticsearch-api (= 8.6.0)
36
+ elasticsearch-api (8.6.0)
36
37
  multi_json
37
- faraday (1.10.1)
38
- faraday-em_http (~> 1.0)
39
- faraday-em_synchrony (~> 1.0)
40
- faraday-excon (~> 1.1)
41
- faraday-httpclient (~> 1.0)
42
- faraday-multipart (~> 1.0)
43
- faraday-net_http (~> 1.0)
44
- faraday-net_http_persistent (~> 1.0)
45
- faraday-patron (~> 1.0)
46
- faraday-rack (~> 1.0)
47
- faraday-retry (~> 1.0)
38
+ faraday (2.7.4)
39
+ faraday-net_http (>= 2.0, < 3.1)
48
40
  ruby2_keywords (>= 0.0.4)
49
- faraday-em_http (1.0.0)
50
- faraday-em_synchrony (1.0.0)
51
- faraday-excon (1.1.0)
52
- faraday-httpclient (1.0.1)
53
- faraday-multipart (1.0.4)
54
- multipart-post (~> 2)
55
- faraday-net_http (1.0.1)
56
- faraday-net_http_persistent (1.2.0)
57
- faraday-patron (1.0.0)
58
- faraday-rack (1.0.0)
59
- faraday-retry (1.0.3)
60
- i18n (1.12.0)
41
+ faraday-net_http (3.0.2)
42
+ i18n (1.13.0)
61
43
  concurrent-ruby (~> 1.0)
62
44
  method_source (0.9.2)
63
- minitest (5.16.2)
45
+ minitest (5.18.0)
64
46
  multi_json (1.15.0)
65
- multipart-post (2.2.3)
66
47
  oj (3.10.0)
67
48
  pry (0.12.2)
68
49
  coderay (~> 1.1.0)
@@ -89,7 +70,7 @@ GEM
89
70
  simplecov-html (~> 0.7.1)
90
71
  simplecov-html (0.7.1)
91
72
  timecop (0.9.5)
92
- tzinfo (2.0.5)
73
+ tzinfo (2.0.6)
93
74
  concurrent-ruby (~> 1.0)
94
75
 
95
76
  PLATFORMS
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- <img src="https://s3.amazonaws.com/doximity/logos/elasticity-logotype.svg" width="35%">
1
+ <img src="https://dox-public-assets.s3.amazonaws.com/doximity/logos/elasticity-logotype.svg" width="35%">
2
2
 
3
3
  ---
4
4
 
@@ -36,5 +36,6 @@ Gem::Specification.new do |spec|
36
36
  spec.add_dependency "activemodel", ">= 5.2.0", "< 7.1"
37
37
  spec.add_dependency "activerecord", ">= 5.2.0", "< 7.1"
38
38
  spec.add_dependency "activesupport", ">= 5.2.0", "< 7.1"
39
- spec.add_dependency "elasticsearch", ">= 7", "< 8"
39
+ spec.add_dependency "elasticsearch", ">= 7", "< 8.7"
40
+ spec.add_dependency "elastic-transport", ">= 8.0", "< 8.7"
40
41
  end
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Elasticity
4
2
  class BaseDocument
5
3
  include ::ActiveModel::Model
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Elasticity
4
2
  class Bulk
5
3
  def initialize(client)
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Elasticity
4
2
  class Config
5
3
  def client=(client)
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Elasticity
4
2
  class Document < BaseDocument
5
3
  IndexMapper.set_delegates(singleton_class, :mapper)
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Elasticity
4
2
  class IndexConfig
5
3
  class SubclassError < StandardError; end
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Elasticity
4
2
  class IndexMapper
5
3
  def self.set_delegates(obj, to)
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Elasticity
4
2
  class InstrumentedClient
5
3
  INDICES_METHODS = %w(exists create delete get_settings get_mapping flush refresh get_alias get_aliases put_alias delete_alias exists_alias update_aliases)
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  require "active_support/subscriber"
4
2
  require "active_support/log_subscriber"
5
3
 
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Elasticity
4
2
  class MultiSearch
5
3
  def initialize(msearch_args = {})
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Elasticity
4
2
  class MultiSearchResponseParser
5
3
  class UnknownError < StandardError; end
@@ -18,7 +16,7 @@ module Elasticity
18
16
  private
19
17
 
20
18
  def self.error_for(status)
21
- Elasticsearch::Transport::Transport::ERRORS[status] || UnknownError
19
+ Elastic::Transport::Transport::ERRORS[status] || UnknownError
22
20
  end
23
21
  end
24
22
  end
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  require "elasticity/log_subscriber"
4
2
 
5
3
  module Elasticity
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Elasticity
4
2
  module Search
5
3
  def self.build(client, index_name, document_types, body, search_args = {})
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Elasticity
4
2
  class SegmentedDocument < BaseDocument
5
3
  # Creates a new segment which behaves almost the same as a Document class dynamically
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Elasticity
4
2
  module Strategies
5
3
  # This strategy keeps two aliases that might be mapped to the same index or different index, allowing
@@ -110,7 +108,7 @@ module Elasticity
110
108
  waiting_duration = 0
111
109
  begin
112
110
  @client.index_delete(index: original_index)
113
- rescue Elasticsearch::Transport::Transport::ServerError => e
111
+ rescue Elastic::Transport::Transport::ServerError => e
114
112
  if retryable_error?(e) && retry_delete_on_recoverable_errors && waiting_duration < max_delay
115
113
  waiting_duration += retry_delay
116
114
  sleep(retry_delay)
@@ -176,13 +174,13 @@ module Elasticity
176
174
 
177
175
  def main_indexes
178
176
  @client.index_get_alias(index: "#{@main_alias}-*", name: @main_alias).keys
179
- rescue Elasticsearch::Transport::Transport::Errors::NotFound
177
+ rescue Elastic::Transport::Transport::Errors::NotFound
180
178
  []
181
179
  end
182
180
 
183
181
  def update_indexes
184
182
  @client.index_get_alias(index: "#{@main_alias}-*", name: @update_alias).keys
185
- rescue Elasticsearch::Transport::Transport::Errors::NotFound
183
+ rescue Elastic::Transport::Transport::Errors::NotFound
186
184
  []
187
185
  end
188
186
 
@@ -266,7 +264,7 @@ module Elasticity
266
264
 
267
265
  def settings
268
266
  @client.index_get_settings(index: @main_alias).values.first
269
- rescue Elasticsearch::Transport::Transport::Errors::NotFound
267
+ rescue Elastic::Transport::Transport::Errors::NotFound
270
268
  nil
271
269
  end
272
270
 
@@ -280,7 +278,7 @@ module Elasticity
280
278
 
281
279
  def mapping
282
280
  @client.index_get_mapping(index: @main_alias).values.first
283
- rescue Elasticsearch::Transport::Transport::Errors::NotFound
281
+ rescue Elastic::Transport::Transport::Errors::NotFound
284
282
  nil
285
283
  end
286
284
 
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Elasticity
4
2
  module Strategies
5
3
  class SingleIndex
@@ -82,7 +80,7 @@ module Elasticity
82
80
 
83
81
  def settings
84
82
  @client.index_get_settings(index: @index_name).values.first
85
- rescue Elasticsearch::Transport::Transport::Errors::NotFound
83
+ rescue Elastic::Transport::Transport::Errors::NotFound
86
84
  nil
87
85
  end
88
86
 
@@ -96,7 +94,7 @@ module Elasticity
96
94
 
97
95
  def mapping
98
96
  @client.index_get_mapping(index: @index_name).values.first
99
- rescue Elasticsearch::Transport::Transport::Errors::NotFound
97
+ rescue Elastic::Transport::Transport::Errors::NotFound
100
98
  nil
101
99
  end
102
100
 
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Elasticity
4
2
  module Strategies
5
3
  class IndexError < StandardError
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Elasticity
4
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
5
3
  end
data/lib/elasticity.rb CHANGED
@@ -21,6 +21,7 @@ require "arel"
21
21
  require "active_support/core_ext"
22
22
  require "active_model"
23
23
  require "elasticsearch"
24
+ require "elastic/transport"
24
25
 
25
26
  module Elasticity
26
27
  autoload :Bulk, "elasticity/bulk"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: es-elasticity
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Kochenburger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-10 00:00:00.000000000 Z
11
+ date: 2023-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -233,7 +233,7 @@ dependencies:
233
233
  version: '7'
234
234
  - - "<"
235
235
  - !ruby/object:Gem::Version
236
- version: '8'
236
+ version: '8.7'
237
237
  type: :runtime
238
238
  prerelease: false
239
239
  version_requirements: !ruby/object:Gem::Requirement
@@ -243,7 +243,27 @@ dependencies:
243
243
  version: '7'
244
244
  - - "<"
245
245
  - !ruby/object:Gem::Version
246
- version: '8'
246
+ version: '8.7'
247
+ - !ruby/object:Gem::Dependency
248
+ name: elastic-transport
249
+ requirement: !ruby/object:Gem::Requirement
250
+ requirements:
251
+ - - ">="
252
+ - !ruby/object:Gem::Version
253
+ version: '8.0'
254
+ - - "<"
255
+ - !ruby/object:Gem::Version
256
+ version: '8.7'
257
+ type: :runtime
258
+ prerelease: false
259
+ version_requirements: !ruby/object:Gem::Requirement
260
+ requirements:
261
+ - - ">="
262
+ - !ruby/object:Gem::Version
263
+ version: '8.0'
264
+ - - "<"
265
+ - !ruby/object:Gem::Version
266
+ version: '8.7'
247
267
  description: Elasticity provides a higher level abstraction on top of [elasticsearch-ruby](https://github.com/elasticsearch/elasticsearch-ruby)
248
268
  gem
249
269
  email:
@@ -304,7 +324,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
304
324
  - !ruby/object:Gem::Version
305
325
  version: '0'
306
326
  requirements: []
307
- rubygems_version: 3.3.11
327
+ rubygems_version: 3.4.10
308
328
  signing_key:
309
329
  specification_version: 4
310
330
  summary: ActiveModel-based library for working with Elasticsearch