v0.15.0 ๐
·
23 commits
to refs/heads/main
since this release
โ ๏ธ Breaking changes
- Rename top-level module MeiliSearch to Meilisearch (#384) @ellnix
We are now consistent with other usage ofMeilisearch. Here is a convenient one-liner to move to the new spelling:Using the old spelling is still functional, but will throw a warning for the time being.find . -type f -exec sed -i 's/MeiliSearch/Meilisearch/g' {} \;
๐ Enhancements
- Support scopes in multi_search (#405) @ellnix
You can now apply ActiveRecord scopes to multi_search:With this change, themulti_search_results = Meilisearch::Rails.multi_search( # scope may be a relation 'books' => { q: 'Harry', scope: Book.where("year < 2005") }, # or a model 'mangas' => { q: 'Attack', scope: Manga } )
:class_nameoption has been deprecated (since:scopeachieves the same outcome), using it will cause a warning to be logged. - Add federated search (#393) @ellnix
This gem now supports federated search! Federated search is similar to multi-search, except the results are a single array sorted by ranking rules:results = Meilisearch::Rails.federated_search( queries: [ { q: 'Harry', scope: Book.all }, { q: 'Attack on Titan', scope: Manga.all } ] )
Learn more in the README.<ul> <% results.each do |record| %> <li><%= record.title %></li> <% end %> </ul> <ul> <!-- Attack on Titan appears first even though it was specified second, it's ranked higher because it's a closer match --> <li>Attack on Titan</li> <li>Harry Potter and the Philosopher's Stone</li> <li>Harry Potter and the Chamber of Secrets</li> </ul>
Thanks again to @ellnix! ๐