meilisearch / meilisearch-rails

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

Check if attributes have changed before index #288

Closed jeremylynch closed 1 year ago

jeremylynch commented 1 year ago

Note that the Algolia equivalent of this gem indexes documents only if attribute(s) have changed. This is described here. Does meilisearch-rails have the same feature?

ellnix commented 1 year ago

Yes, meilisearch-rails has the same feature. However, it only uses the newer will_save_change_to_#{attr} syntax. It is referenced in passing in the README of this repo: https://github.com/meilisearch/meilisearch-rails/#custom-attribute-definition.

See the implementation: https://github.com/meilisearch/meilisearch-rails/blob/e7a12569f18ee40684c3c643a3cf573f3465c62e/lib/meilisearch-rails.rb#L853C1-L853C1

brunoocasali commented 1 year ago

I'll close this issue since it was answered by the community. Feel free to reopen if you want @jeremylynch.

Thanks a lot @ellnix you rock 🎉