I have seen this done in other rails application where you can search for a term and it would search across multiple models and return results from each. What is the best gem to use for this purpose?
Is there a episode in GoRails for Searching and Filtering?
Searchkick with Elasticsearch is pretty good for searching models and is very flexible. It's my go-to solution with searching.
Here's an episode on Searchkick
You could also look into using Ransack I believe is another popular gem for it.
Like Andrew said, Searchkick is perfect for this. Each model gets an index inside ElasticSearch and then searchkick lets you query over those by simply doing this: https://github.com/ankane/searchkick#multiple-indices All that should make sense after watching the screencast. 😎
Ransack isn't quite the same in that it doesn't index them in a way that you could search multiple models together. You'd actually have to search each table separately and then combine the results in your view. It's nothing fancy as it just does database queries which makes it really easy to implement without any separate services, but more rudimentary in a sense.
Join 29,763+ developers who get early access to new screencasts, articles, guides, updates, and more.