searchkick 5.5.0 → 5.5.2

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: 37b82bea130dfffde9634bf74e4e078e97bbe6e8d0b4e540c13800c765ddc6c3
4
- data.tar.gz: 2435f38ff18bf471673e1df11f0fd96cfacb408cf390e04afcc068488777a358
3
+ metadata.gz: 0dcc2cd0d75261c06eb8fcde9f02cb7a3e4d76e2e092637674bc746362bcf538
4
+ data.tar.gz: c75262636ff5a1a81da94cfd6c22cd2894ef47775c89f3bfbdb43b9393bb3df3
5
5
  SHA512:
6
- metadata.gz: f0541cc6673c2382ec82bce16bb5c230fa0fb3220d6430324739c8fb722ca75f8f70d33c1833642ee03edc936f8dba88c37282cdf6e200ead84ae16688054307
7
- data.tar.gz: 7522e671cf005d61a5df2856e6754605570f281f6e4b359f537f4a9d6cfe17eccad1466b81adbb683b782c9941caac4f935a2244094f7af11b09f58954d173ff
6
+ metadata.gz: db569b2dd7e4a886f969ecb46c7efbdb3a4a85cacb5ca1fd5e73aed042ddc002866e7832e797efaa94b16940bb1720f7951cbcfdb13019c4bded61f016b844cb
7
+ data.tar.gz: 2faeab514b83caf7ada0fc59a9d26699a5a2e67670ecb2cac15e0ed539bc6f06c7a74736f608be96753d238e441af4e2c27e9bea2b9b49a5b2bfe41236853ef3
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 5.5.2 (2025-05-20)
2
+
3
+ - Fixed `scope` option for partial reindex
4
+
5
+ ## 5.5.1 (2025-04-24)
6
+
7
+ - Added support for `elasticsearch` 9 gem
8
+
1
9
  ## 5.5.0 (2025-04-03)
2
10
 
3
11
  - Added `m` and `ef_construction` to `knn` index option
data/README.md CHANGED
@@ -64,7 +64,7 @@ gem "elasticsearch" # select one
64
64
  gem "opensearch-ruby" # select one
65
65
  ```
66
66
 
67
- The latest version works with Elasticsearch 7 and 8 and OpenSearch 1 and 2. For Elasticsearch 6, use version 4.6.3 and [this readme](https://github.com/ankane/searchkick/blob/v4.6.3/README.md).
67
+ The latest version works with Elasticsearch 7, 8, and 9 and OpenSearch 1, 2, and 3. For Elasticsearch 6, use version 4.6.3 and [this readme](https://github.com/ankane/searchkick/blob/v4.6.3/README.md).
68
68
 
69
69
  Add searchkick to models you want to search.
70
70
 
@@ -231,10 +231,11 @@ module Searchkick
231
231
 
232
232
  if method_name || (scoped && !full)
233
233
  mode = options.delete(:mode) || :inline
234
+ scope = options.delete(:scope)
234
235
  raise ArgumentError, "unsupported keywords: #{options.keys.map(&:inspect).join(", ")}" if options.any?
235
236
 
236
237
  # import only
237
- import_scope(relation, method_name: method_name, mode: mode)
238
+ import_scope(relation, method_name: method_name, mode: mode, scope: scope)
238
239
  self.refresh if refresh
239
240
  true
240
241
  else
@@ -1,3 +1,3 @@
1
1
  module Searchkick
2
- VERSION = "5.5.0"
2
+ VERSION = "5.5.2"
3
3
  end
data/lib/searchkick.rb CHANGED
@@ -92,6 +92,7 @@ module Searchkick
92
92
  if client_type == :opensearch
93
93
  OpenSearch::Client.new({
94
94
  url: ENV["OPENSEARCH_URL"],
95
+ # TODO remove headers in Searchkick 6
95
96
  transport_options: {request: {timeout: timeout}, headers: {content_type: "application/json"}},
96
97
  retry_on_failure: 2
97
98
  }.deep_merge(client_options)) do |f|
@@ -101,9 +102,15 @@ module Searchkick
101
102
  else
102
103
  raise Error, "The `elasticsearch` gem must be 7+" if Elasticsearch::VERSION.to_i < 7
103
104
 
105
+ transport_options = {request: {timeout: timeout}}
106
+ # TODO remove headers in Searchkick 6
107
+ if Elasticsearch::VERSION.to_i < 9
108
+ transport_options[:headers] = {content_type: "application/json"}
109
+ end
110
+
104
111
  Elasticsearch::Client.new({
105
112
  url: ENV["ELASTICSEARCH_URL"],
106
- transport_options: {request: {timeout: timeout}, headers: {content_type: "application/json"}},
113
+ transport_options: transport_options,
107
114
  retry_on_failure: 2
108
115
  }.deep_merge(client_options)) do |f|
109
116
  f.use Searchkick::Middleware
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: searchkick
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.5.0
4
+ version: 5.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-04-03 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: activemodel
@@ -91,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
91
  - !ruby/object:Gem::Version
92
92
  version: '0'
93
93
  requirements: []
94
- rubygems_version: 3.6.2
94
+ rubygems_version: 3.6.7
95
95
  specification_version: 4
96
96
  summary: Intelligent search made easy with Rails and Elasticsearch or OpenSearch
97
97
  test_files: []