meilisearch / meilisearch-rails

Meilisearch integration for Ruby on Rails
https://www.meilisearch.com
MIT License
308 stars 47 forks source link

Add support for distinct attribute #272

Closed jeremylynch closed 1 year ago

jeremylynch commented 1 year ago

Would be great if we could support the distinctAttribute

https://www.meilisearch.com/docs/learn/configuration/distinct

brunoocasali commented 1 year ago

Hi @jeremylynch!

Have you tried this?

class Book < ApplicationRecord
  include MeiliSearch::Rails

  meilisearch do
    distinct_attribute [:title]
  end
end
brunoocasali commented 1 year ago

I believe this is not an error since we have this config declared here: lib/meilisearch-rails.rb:55