meilisearch-rails 0.2.1 → 0.2.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: e9d980447aeb2f250944f90bb5f4b3d3a9f331dfe05eebe7c60408e728deeaf9
4
- data.tar.gz: 75bf6d2db221921786720f7563cbe7371b164d223c3af42295bd8716e32005e8
3
+ metadata.gz: 9eae547864046ca0beb6cf7de6fa4458ff7449d9ba9c6d4ac4172d221cb8de3b
4
+ data.tar.gz: acbed5cdbf3c63c68c39fef9d3e24620dd14ef5c47d6eabb5da7e96d57dd1a98
5
5
  SHA512:
6
- metadata.gz: f07ded69841b317d70a3cdbbfd266276500b67e415d147bdb620523e203f6ca7a7a1ad10b3460aa2d6827c5417cc24dddc72427815d2fb648cdc48021e96d385
7
- data.tar.gz: 168f2e51985ba54159565ab4b1eb0f7c205a3e32a61a5bdd8335179c37fe97f89fc25f34580316acae3a7b40df24e898b8a9a270b704da0a7013e1631284aa21
6
+ metadata.gz: a9b0017613ec9bf55fae9d4cb2e847a841d84078968a57d1940425e10ad5062ce747ee888837efd75b9b8826136dec52fd283759d05cbdaae7cc5b9eb237d1c7
7
+ data.tar.gz: fd67c80baf0598425ef427ec50a6a849e736a704439e0eab67c29175979d4b69b26d1f15a97421ffec204a2dd047bc5f045dafd690e179c9a5eab2be05ab7b99
data/Gemfile CHANGED
@@ -1,7 +1,7 @@
1
1
  source "http://rubygems.org"
2
2
 
3
3
  gem 'json', '~> 2.5', '>= 2.5.1'
4
- gem 'meilisearch', '~> 0.15.3'
4
+ gem 'meilisearch', '~> 0.16.0'
5
5
 
6
6
  if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'rbx'
7
7
  gem 'rubysl', '~> 2.0', :platform => :rbx
data/README.md CHANGED
@@ -65,7 +65,7 @@ To learn more about MeiliSearch, check out our [Documentation](https://docs.meil
65
65
 
66
66
  ## 🤖 Compatibility with MeiliSearch
67
67
 
68
- This package only guarantees the compatibility with the [version v0.20.0 of MeiliSearch](https://github.com/meilisearch/MeiliSearch/releases/tag/v0.20.0).
68
+ This package only guarantees the compatibility with the [version v0.21.0 of MeiliSearch](https://github.com/meilisearch/MeiliSearch/releases/tag/v0.21.0).
69
69
 
70
70
  ## 🔧 Installation
71
71
 
@@ -207,13 +207,12 @@ class Book < ApplicationRecord
207
207
 
208
208
  meilisearch do
209
209
  searchable_attributes [:title, :author, :publisher, :description]
210
- attributes_for_faceting [:genre]
210
+ filterable_attributes [:genre]
211
211
  ranking_rules [
212
212
  'proximity',
213
213
  'typo',
214
214
  'words',
215
215
  'attribute',
216
- 'wordsPosition',
217
216
  'exactness',
218
217
  'desc(publication_year)'
219
218
  ]
@@ -234,7 +233,7 @@ Check the dedicated section of the documentation, for more information on the [s
234
233
  All the supported options are described in the [search parameters](https://docs.meilisearch.com/reference/features/search_parameters.html) section of the documentation.
235
234
 
236
235
  ```ruby
237
- Book.search('Harry', filters: 'author = J. K. Rowling')
236
+ Book.search('Harry', attributesToHighlight: ['*'])
238
237
  ```
239
238
  👉 Don't forget that `attributes_to_highlight`, `attributes_to_crop`, and
240
239
  `crop_length` can be set up in the `meilisearch` block of your model.
@@ -284,13 +283,13 @@ class Author < ApplicationRecord
284
283
  meilisearch do
285
284
  attribute :first_name, :last_name
286
285
  attribute :full_name do
287
- '#{first_name} #{last_name}'
286
+ "#{first_name} #{last_name}"
288
287
  end
289
288
  add_attribute :full_name_reversed
290
289
  end
291
290
 
292
291
  def full_name_reversed
293
- '#{last_name} #{first_name}'
292
+ "#{last_name} #{first_name}"
294
293
  end
295
294
 
296
295
  def will_save_change_to_full_name?
@@ -9,7 +9,11 @@ module MeiliSearch
9
9
  class Kaminari < ::Kaminari::PaginatableArray
10
10
 
11
11
  def initialize(array, options)
12
- super(array, options)
12
+ if RUBY_VERSION >= '3'
13
+ super(array, **options)
14
+ else
15
+ super(array, options)
16
+ end
13
17
  end
14
18
 
15
19
  def limit(num)
@@ -1,3 +1,3 @@
1
1
  module MeiliSearch
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.2'
3
3
  end
@@ -53,7 +53,7 @@ module MeiliSearch
53
53
  # MeiliSearch settings
54
54
  OPTIONS = [
55
55
  :searchableAttributes,
56
- :attributesForFaceting,
56
+ :filterableAttributes,
57
57
  :displayedAttributes,
58
58
  :distinctAttribute,
59
59
  :synonyms,
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.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Meili
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-07 00:00:00.000000000 Z
11
+ date: 2021-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json