meilisearch 0.26.0 → 0.27.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 +4 -4
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/lib/meilisearch/client.rb +6 -0
- data/lib/meilisearch/error.rb +14 -10
- data/lib/meilisearch/index.rb +14 -0
- data/lib/meilisearch/utils.rb +1 -1
- data/lib/meilisearch/version.rb +1 -1
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41cfeec247ef2cdaef19f6ddade5d32b7dcc80cbc69fe500c9310f7dab87e5a4
|
4
|
+
data.tar.gz: af889a896d762a38fbb1af56aba3b462cf73f35e4fe97048ef09bbaad44ffa53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ce24688fe857e840d07efda981cc00d0f8a60982aea1d487646b21a82117693eaa61fbe9dc778512b00b7d2363001c68dca0387f7b7a550a00eee022133c046
|
7
|
+
data.tar.gz: fda38ae00c08ba533e76dc0ce9a101331b23fb47e6c9554478a6027f1524b92141c6ecc764dce974402e66db67b9e6d85a96ff74893eb3419d0a9f02865b1cec
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -53,7 +53,7 @@ Say goodbye to server deployment and manual updates with [Meilisearch Cloud](htt
|
|
53
53
|
|
54
54
|
## 🔧 Installation
|
55
55
|
|
56
|
-
This package requires Ruby version
|
56
|
+
This package requires Ruby version 3.0.0 or later.
|
57
57
|
|
58
58
|
With `gem` in command line:
|
59
59
|
```bash
|
data/lib/meilisearch/client.rb
CHANGED
data/lib/meilisearch/error.rb
CHANGED
@@ -21,26 +21,30 @@ module MeiliSearch
|
|
21
21
|
alias link ms_link
|
22
22
|
|
23
23
|
def initialize(http_code, http_message, http_body)
|
24
|
-
get_meilisearch_error_info(http_body) unless http_body.nil? || http_body.empty?
|
25
24
|
@http_code = http_code
|
26
25
|
@http_message = http_message
|
27
|
-
@
|
28
|
-
@
|
26
|
+
@http_body = parse_body(http_body)
|
27
|
+
@ms_code = @http_body['code']
|
28
|
+
@ms_type = @http_body['type']
|
29
|
+
@ms_message = @http_body.fetch('message', 'MeiliSearch API has not returned any error message')
|
30
|
+
@ms_link = @http_body.fetch('link', '<no documentation link found>')
|
29
31
|
@message = "#{http_code} #{http_message} - #{@ms_message}. See #{ms_link}."
|
30
32
|
super(details)
|
31
33
|
end
|
32
34
|
|
33
|
-
def
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
35
|
+
def parse_body(http_body)
|
36
|
+
if http_body.respond_to?(:to_hash)
|
37
|
+
http_body.to_hash
|
38
|
+
elsif http_body.respond_to?(:to_str)
|
39
|
+
JSON.parse(http_body.to_str)
|
40
|
+
else
|
41
|
+
{}
|
42
|
+
end
|
39
43
|
rescue JSON::ParserError
|
40
44
|
# We might receive a JSON::ParserError when, for example, MeiliSearch is running behind
|
41
45
|
# some proxy (ELB or Nginx, for example), and the request timeouts, returning us
|
42
46
|
# a raw HTML body instead of a JSON as we were expecting
|
43
|
-
|
47
|
+
{ 'message' => "The server has not returned a valid JSON HTTP body: #{http_body}" }
|
44
48
|
end
|
45
49
|
|
46
50
|
def details
|
data/lib/meilisearch/index.rb
CHANGED
@@ -514,5 +514,19 @@ module MeiliSearch
|
|
514
514
|
def reset_non_separator_tokens
|
515
515
|
http_delete("/indexes/#{@uid}/settings/non-separator-tokens")
|
516
516
|
end
|
517
|
+
|
518
|
+
### SETTINGS - PROXIMITY PRECISION
|
519
|
+
|
520
|
+
def proximity_precision
|
521
|
+
http_get("/indexes/#{@uid}/settings/proximity-precision")
|
522
|
+
end
|
523
|
+
|
524
|
+
def update_proximity_precision(proximity_precision_attribute)
|
525
|
+
http_put("/indexes/#{@uid}/settings/proximity-precision", proximity_precision_attribute)
|
526
|
+
end
|
527
|
+
|
528
|
+
def reset_proximity_precision
|
529
|
+
http_delete("/indexes/#{@uid}/settings/proximity-precision")
|
530
|
+
end
|
517
531
|
end
|
518
532
|
end
|
data/lib/meilisearch/utils.rb
CHANGED
data/lib/meilisearch/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: meilisearch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.27.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Meili
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -51,7 +51,8 @@ files:
|
|
51
51
|
homepage: https://github.com/meilisearch/meilisearch-ruby
|
52
52
|
licenses:
|
53
53
|
- MIT
|
54
|
-
metadata:
|
54
|
+
metadata:
|
55
|
+
rubygems_mfa_required: 'true'
|
55
56
|
post_install_message:
|
56
57
|
rdoc_options: []
|
57
58
|
require_paths:
|
@@ -60,14 +61,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
60
61
|
requirements:
|
61
62
|
- - ">="
|
62
63
|
- !ruby/object:Gem::Version
|
63
|
-
version:
|
64
|
+
version: 3.0.0
|
64
65
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
65
66
|
requirements:
|
66
67
|
- - ">="
|
67
68
|
- !ruby/object:Gem::Version
|
68
69
|
version: '0'
|
69
70
|
requirements: []
|
70
|
-
rubygems_version: 3.
|
71
|
+
rubygems_version: 3.2.33
|
71
72
|
signing_key:
|
72
73
|
specification_version: 4
|
73
74
|
summary: An easy-to-use ruby client for Meilisearch API
|