Rails - Search Controller

I am going to create search capabilities in my application. I want the search to be able to span multiple models.

I am thinking of adding a search controller that would then determine which models to search based on settings, etc.

What do you think? Is the search controller working correctly or is there something open that I should think about?

thanks

+4
source share
3 answers

You have several search options in the ruby ​​world, for example

  • Sphinx
  • Ferret
  • Solr
  • Endeca

Looking through the documentation for the hero, the hero offers with solr, which is an amazing search engine. http://docs.heroku.com/websolr and http://docs.heroku.com/full-text-search details more about this. We chose solr to search in one of our projects and we used sunspot_rails, which integrates perfectly with your models and reindexed when your content changes. We used the gem sunspot_rails from http://github.com/outoftime/sunspot , which is also recommended by the hero.

The caveat is that the heroku file system is read-only and does not allow arbitrary processes to be started, so you need to choose one of them, for example websolr (starting at $ 20 per month), or create your own instance of amazon ec2 and do the indexing there. Since the hero also works on amazon ec2, latency is very low.

Returning to the alternatives, Ferret, as you know, often leads to failure / corruption of indexes. Sphinx is not supported by heroics. Endeca is damn expensive, you have to spend most of your budget, even to get the main results.

+4
source

If you use Postgres, you can use pg_search gem

+3
source

I would say don't avoid rolling back your own search engine unless you have special needs that cannot be met by something like Sphinx (also read this )

+2
source

All Articles