Forum: Ruby on Rails Search multiple tables

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
bob (Guest)
on 2008-11-11 08:14
(Received via mailing list)

I am trying to create a search feature that queries multiple tables,
and returns results from all tables in a single paginated query, kind
of like the search feature on facebook.  I was wondering if there are
any good ways to do this.


Thorsten M. (Guest)
on 2008-11-11 12:08
(Received via mailing list)
This may depend on the actual number of tables to search,
and on the kind of search.

If it's only two or three, I would go for ActiveRecords :join
or :include
If that gets too complicated I would use pure SQL.
Another option would be a search engine like sphinx.
bob (Guest)
on 2008-11-12 20:32
(Received via mailing list)
Thanks.  I just gave ultrasphinx a try, and it looks promising.  I'm
also considering looking into solr.

Do you have any advice as to how the two stack up?

Thanks again!
This topic is locked and can not be replied to.