README.md in meilisearch-rails-0.2.1 vs README.md in meilisearch-rails-0.2.2
- old
+ new
@@ -63,11 +63,11 @@
To learn more about MeiliSearch, check out our [Documentation](https://docs.meilisearch.com/learn/tutorials/getting_started.html) or our [API References](https://docs.meilisearch.com/reference/api/).
## 🤖 Compatibility with MeiliSearch
-This package only guarantees the compatibility with the [version v0.20.0 of MeiliSearch](https://github.com/meilisearch/MeiliSearch/releases/tag/v0.20.0).
+This package only guarantees the compatibility with the [version v0.21.0 of MeiliSearch](https://github.com/meilisearch/MeiliSearch/releases/tag/v0.21.0).
## 🔧 Installation
This package requires Ruby version 2.6.0 or later and Rails 5.2 or later.
@@ -205,17 +205,16 @@
class Book < ApplicationRecord
include MeiliSearch
meilisearch do
searchable_attributes [:title, :author, :publisher, :description]
- attributes_for_faceting [:genre]
+ filterable_attributes [:genre]
ranking_rules [
'proximity',
'typo',
'words',
'attribute',
- 'wordsPosition',
'exactness',
'desc(publication_year)'
]
synonyms nyc: ['new york']
@@ -232,11 +231,11 @@
## 🔍 Custom search
All the supported options are described in the [search parameters](https://docs.meilisearch.com/reference/features/search_parameters.html) section of the documentation.
```ruby
-Book.search('Harry', filters: 'author = J. K. Rowling')
+Book.search('Harry', attributesToHighlight: ['*'])
```
👉 Don't forget that `attributes_to_highlight`, `attributes_to_crop`, and
`crop_length` can be set up in the `meilisearch` block of your model.
## 🪛 Options
@@ -282,16 +281,16 @@
include MeiliSearch
meilisearch do
attribute :first_name, :last_name
attribute :full_name do
- '#{first_name} #{last_name}'
+ "#{first_name} #{last_name}"
end
add_attribute :full_name_reversed
end
def full_name_reversed
- '#{last_name} #{first_name}'
+ "#{last_name} #{first_name}"
end
def will_save_change_to_full_name?
will_save_change_to_first_name? || will_save_change_to_last_name?
end