meilisearch-rails 0.10.1 → 0.10.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/meilisearch/rails/pagination.rb +1 -1
- data/lib/meilisearch/rails/version.rb +1 -1
- data/lib/meilisearch-rails.rb +20 -1
- data/meilisearch-rails.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb990c26e799658b655df059ea7a22b4cfc7511a88e7581d72c27841b736f74f
|
4
|
+
data.tar.gz: c2457a258356732877729a9f110a8f392316a98d725d6d052f2dc64824a3ea2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7499509091a149069f1322e3ceec9c789432c3495d8c2754d258bb17c5cc1d70a410ebcd41e1eb76bcbe50b3c9e301044d0a5e6931e94bdd8779eb290e9eaecf
|
7
|
+
data.tar.gz: 68173b7d7767308144b6987c35c9c2fb75806959a6fcdc3ee3545cab88779d24e013dea0ea0b3b0a3182f8fb9bcd5c7e1634aaf89ecd39f4cb7ad21231b95a0b
|
data/README.md
CHANGED
@@ -29,7 +29,7 @@
|
|
29
29
|
|
30
30
|
**Meilisearch** is an open-source search engine. [Learn more about Meilisearch.](https://github.com/meilisearch/meilisearch)
|
31
31
|
|
32
|
-
## Table of Contents <!-- omit in
|
32
|
+
## Table of Contents <!-- omit in TOC -->
|
33
33
|
|
34
34
|
- [📖 Documentation](#-documentation)
|
35
35
|
- [⚡ Supercharge your Meilisearch experience](#-supercharge-your-meilisearch-experience)
|
@@ -329,7 +329,7 @@ Check [`ddnexus/pagy`](https://ddnexus.github.io/pagy/extras/meilisearch) for mo
|
|
329
329
|
|
330
330
|
#### Deactivate Meilisearch in certain moments
|
331
331
|
|
332
|
-
By default HTTP connections to the Meilisearch URL
|
332
|
+
By default, HTTP connections to the Meilisearch URL are always active, but sometimes you want to disable the HTTP requests in a particular moment or environment.<br>
|
333
333
|
you have multiple ways to achieve this.
|
334
334
|
|
335
335
|
By adding `active: false` in the configuration initializer:
|
@@ -17,7 +17,7 @@ module MeiliSearch
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def self.log_pagy_error
|
20
|
-
|
20
|
+
MeiliSearch::Rails.logger
|
21
21
|
.warning('[meilisearch-rails] Remove `pagination_backend: :pagy` from your initializer, `pagy` it is not required for `pagy`')
|
22
22
|
end
|
23
23
|
|
data/lib/meilisearch-rails.rb
CHANGED
@@ -39,6 +39,10 @@ module MeiliSearch
|
|
39
39
|
include InstanceMethods
|
40
40
|
end
|
41
41
|
end
|
42
|
+
|
43
|
+
def logger
|
44
|
+
@logger ||= (::Rails.logger || Logger.new($stdout))
|
45
|
+
end
|
42
46
|
end
|
43
47
|
|
44
48
|
class IndexSettings
|
@@ -304,7 +308,7 @@ module MeiliSearch
|
|
304
308
|
raise e if raise_on_failure
|
305
309
|
|
306
310
|
# log the error
|
307
|
-
|
311
|
+
MeiliSearch::Rails.logger.info("[meilisearch-rails] #{e.message}")
|
308
312
|
# return something
|
309
313
|
case method.to_s
|
310
314
|
when 'search'
|
@@ -444,6 +448,8 @@ module MeiliSearch
|
|
444
448
|
after_destroy { |searchable| searchable.ms_enqueue_remove_from_index!(ms_synchronous?) }
|
445
449
|
end
|
446
450
|
end
|
451
|
+
|
452
|
+
warn_searchable_missing_attributes
|
447
453
|
end
|
448
454
|
|
449
455
|
def ms_without_auto_index(&block)
|
@@ -858,6 +864,19 @@ module MeiliSearch
|
|
858
864
|
# We don't know if the attribute has changed, so conservatively assume it has
|
859
865
|
true
|
860
866
|
end
|
867
|
+
|
868
|
+
def warn_searchable_missing_attributes
|
869
|
+
searchables = meilisearch_settings.get_setting(:searchable_attributes)
|
870
|
+
attrs = meilisearch_settings.get_setting(:attributes)&.keys
|
871
|
+
|
872
|
+
if searchables.present? && attrs.present?
|
873
|
+
(searchables.map(&:to_s) - attrs.map(&:to_s)).each do |missing_searchable|
|
874
|
+
MeiliSearch::Rails.logger.warn(
|
875
|
+
"[meilisearch-rails] #{name}##{missing_searchable} declared in searchable_attributes but not in attributes. Please add it to attributes if it should be searchable."
|
876
|
+
)
|
877
|
+
end
|
878
|
+
end
|
879
|
+
end
|
861
880
|
end
|
862
881
|
|
863
882
|
# these are the instance methods included
|
data/meilisearch-rails.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: meilisearch-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Meili
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: meilisearch
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.26.0
|
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: 0.
|
26
|
+
version: 0.26.0
|
27
27
|
description: Meilisearch integration for Ruby on Rails. See https://github.com/meilisearch/meilisearch
|
28
28
|
email: bonjour@meilisearch.com
|
29
29
|
executables: []
|
@@ -70,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
70
70
|
- !ruby/object:Gem::Version
|
71
71
|
version: '0'
|
72
72
|
requirements: []
|
73
|
-
rubygems_version: 3.
|
73
|
+
rubygems_version: 3.1.6
|
74
74
|
signing_key:
|
75
75
|
specification_version: 4
|
76
76
|
summary: Meilisearch integration for Ruby on Rails.
|