searchkick 5.1.0 → 5.1.2

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: 4f8772937f9490975f3e21a5dbd7e2ddc18da42959a42a991875e4d04caca549
4
- data.tar.gz: c10ee19a6feb618cc6d84da994053ed3996b97aaeac85d2c6510246ba4dfd7cf
3
+ metadata.gz: 93a4b2478d1c1353f7117fff60a08a50c896a1b78e150abf1a6b328901933e4d
4
+ data.tar.gz: 1ff1fac4e47194445ca9f0ec2a470b7f15fe9aeb135960aa874e1a6beff62a2e
5
5
  SHA512:
6
- metadata.gz: d6e13f2d84a1869b912732befa604da472a020a5862e8387916bc1c8fb57e24f23a899d774d043f5af2a93856b25278f618e16ffd177a7fe035844660dfc1723
7
- data.tar.gz: 53b5c913f753a9f8c0ef2d2de3c7f1c2fd21c5a456919a453d0f48f8a891b73e57e0746d30d669c0d0d0f89c4cd174559a616d715aee4b6dc55aa627a420963e
6
+ metadata.gz: 52f8ccfb7f3615492a1674c7d48878b31bc9fd4e8cb8c411fbb19020d910c1ce395764aa1e378fab8e59294a7f5ef0bd2db0f9cd32c728dd302984ded4c7f20d
7
+ data.tar.gz: 0c26ce9bb674b6aa5744edfd8567024a1f1d50fb30b6096abcdfdc23c73a71afbb9310a56809cc135b2d30653e1330cfa057fd9778e005a2aeeb1d354d7686af
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 5.1.2 (2023-01-29)
2
+
3
+ - Fixed error with missing point in time
4
+
5
+ ## 5.1.1 (2022-12-05)
6
+
7
+ - Added support for strings for `offset` and `per_page`
8
+
1
9
  ## 5.1.0 (2022-10-12)
2
10
 
3
11
  - Added support for fractional search timeout
data/README.md CHANGED
@@ -43,8 +43,6 @@ Check out [Searchjoy](https://github.com/ankane/searchjoy) for analytics and [Au
43
43
  - [Reference](#reference)
44
44
  - [Contributing](#contributing)
45
45
 
46
- Searchkick 5.0 was recently released! See [how to upgrade](#upgrading)
47
-
48
46
  ## Getting Started
49
47
 
50
48
  Install [Elasticsearch](https://www.elastic.co/downloads/elasticsearch) or [OpenSearch](https://opensearch.org/downloads.html). For Homebrew, use:
@@ -1112,7 +1110,7 @@ Restaurant.search("soup", where: {bounds: {geo_shape: {type: "polygon", coordina
1112
1110
  Falling entirely within the query shape
1113
1111
 
1114
1112
  ```ruby
1115
- Restaurant.search("salad", where: {bounds: {geo_shape: {type: "circle", relation: "within", coordinates: [{lat: 38, lon: -123}], radius: "1km"}}})
1113
+ Restaurant.search("salad", where: {bounds: {geo_shape: {type: "circle", relation: "within", coordinates: {lat: 38, lon: -123}, radius: "1km"}}})
1116
1114
  ```
1117
1115
 
1118
1116
  Not touching the query shape
@@ -199,7 +199,11 @@ module Searchkick
199
199
  def handle_error(e)
200
200
  status_code = e.message[1..3].to_i
201
201
  if status_code == 404
202
- raise MissingIndexError, "Index missing - run #{reindex_command}"
202
+ if e.message.include?("No search context found for id")
203
+ raise MissingIndexError, "No search context found for id"
204
+ else
205
+ raise MissingIndexError, "Index missing - run #{reindex_command}"
206
+ end
203
207
  elsif status_code == 500 && (
204
208
  e.message.include?("IllegalArgumentException[minimumSimilarity >= 1]") ||
205
209
  e.message.include?("No query registered for [multi_match]") ||
@@ -251,7 +255,7 @@ module Searchkick
251
255
  default_limit = searchkick_options[:deep_paging] ? 1_000_000_000 : 10_000
252
256
  per_page = (options[:limit] || options[:per_page] || default_limit).to_i
253
257
  padding = [options[:padding].to_i, 0].max
254
- offset = options[:offset] || (page - 1) * per_page + padding
258
+ offset = (options[:offset] || (page - 1) * per_page + padding).to_i
255
259
  scroll = options[:scroll]
256
260
 
257
261
  max_result_window = searchkick_options[:max_result_window]
@@ -1,3 +1,3 @@
1
1
  module Searchkick
2
- VERSION = "5.1.0"
2
+ VERSION = "5.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: searchkick
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.0
4
+ version: 5.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-13 00:00:00.000000000 Z
11
+ date: 2023-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -92,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
92
  - !ruby/object:Gem::Version
93
93
  version: '0'
94
94
  requirements: []
95
- rubygems_version: 3.3.7
95
+ rubygems_version: 3.4.1
96
96
  signing_key:
97
97
  specification_version: 4
98
98
  summary: Intelligent search made easy with Rails and Elasticsearch or OpenSearch