<p>There are several plugin options for building a search engine into your Ruby on Rails application.  Which of these is the best?</p>

<ul>
<li><a href="http://ts.freelancing-gods.com/" rel="noreferrer">Thinking Sphinx</a></li>
<li><a href="http://blog.evanweaver.com/files/doc/fauna/ultrasphinx/files/README.html" rel="noreferrer">UltraSphinx</a></li>
<li><a href="http://seattlerb.rubyforge.org/Sphincter/" rel="noreferrer">Sphincter</a></li>
<li><a href="http://www.datanoise.com/articles/2007/3/23/acts_as_sphinx-plugin" rel="noreferrer">acts_as_sphinx</a></li>
<li><a href="http://projects.jkraemer.net/acts_as_ferret/" rel="noreferrer">acts_as_ferret</a></li>
<li><a href="http://ferret.davebalmain.com/trac/" rel="noreferrer">Ferret</a></li>
<li><a href="http://locomotivation.com/2008/07/23/simple-ruby-on-rails-full-text-search-using-xapian" rel="noreferrer">acts_as_xapian</a></li>
<li><a href="http://github.com/railsfreaks/acts_as_solr/tree/master" rel="noreferrer">acts_as_solr</a></li>
<li><a href="http://hyperestraier.sourceforge.net/" rel="noreferrer">Hyper Estraier</a></li>
</ul>

[{'answer_id': 73554, 'author': 'Otto', 'author_id': 9594, 'author_profile': 'https://Stackoverflow.com/users/9594', 'pm_score': 0, 'selected': False, 'text': "<p>I've used Thinking Sphinx and it seems pretty good, but I haven't had the time to evaluate all of the options.</p>\n"}, {'answer_id': 73573, 'author': 'ivan', 'author_id': 7039, 'author_profile': 'https://Stackoverflow.com/users/7039', 'pm_score': 0, 'selected': False, 'text': '<p>I recommend Thinking Sphinx. It is the fastest option in my opinion.</p>\n'}, {'answer_id': 73604, 'author': 'Kevin', 'author_id': 4599, 'author_profile': 'https://Stackoverflow.com/users/4599', 'pm_score': 0, 'selected': False, 'text': "<p>I've used Ferret and it worked well for my purposes, but I have not evaluated the other options.</p>\n"}, {'answer_id': 73618, 'author': 'squadette', 'author_id': 7754, 'author_profile': 'https://Stackoverflow.com/users/7754', 'pm_score': 5, 'selected': True, 'text': '<p>Thinking Sphinx has more concise syntax to define which fields and which models are indexed.</p>\n\n<p>Both UltraSphinx and Thinking Sphinx (recently) have ultra-cool feature which takes into account geographical proximity of objects. </p>\n\n<p>UltraSphinx has annoying problems with how it loads models (it does not load entire Rails stack, so you could get strange and hard to diagnose errors, which are handled by adding explicit <code>require</code> statements).</p>\n\n<p>We use Thinking Sphinx on new projects, and UltraSphinx on projects which use geo content.</p>\n'}, {'answer_id': 73712, 'author': 'webmat', 'author_id': 6349, 'author_profile': 'https://Stackoverflow.com/users/6349', 'pm_score': 2, 'selected': False, 'text': '<p>I have only used the Ferret/acts_as_ferret combo (legacy decision) on a client project. I strongly recommend looking at the <strong>other</strong> options first.</p>\n\n<p>aaf is very fragile and can bring your Rails app to a screeching halt if you make a mistake in the config or if for some reason you hit a bug in aaf. </p>\n\n<p>In such a case, instead of simply having the search functionality crapping out, any controller action touching an indexed model will completely fail and raise an exception. Which is baaad, hmkay?</p>\n'}, {'answer_id': 73735, 'author': 'webmat', 'author_id': 6349, 'author_profile': 'https://Stackoverflow.com/users/6349', 'pm_score': 0, 'selected': False, 'text': '<p>An option I haven\'t tried is the C++ based <a href="http://www.xapian.org/" rel="nofollow noreferrer">Xapian</a></p>\n'}, {'answer_id': 73766, 'author': 'Kevin Colyar', 'author_id': 1766771, 'author_profile': 'https://Stackoverflow.com/users/1766771', 'pm_score': 1, 'selected': False, 'text': '<p>I use the <em>acts_as_xapian</em> plugin.  I followed this tutorial: </p>\n\n<p><a href="http://locomotivation.com/2008/07/23/simple-ruby-on-rails-full-text-search-using-xapian" rel="nofollow noreferrer">http://locomotivation.com/2008/07/23/simple-ruby-on-rails-full-text-search-using-xapian</a></p>\n\n<p>Works very well.</p>\n'}, {'answer_id': 73826, 'author': 'webmat', 'author_id': 6349, 'author_profile': 'https://Stackoverflow.com/users/6349', 'pm_score': 3, 'selected': False, 'text': '<p>A solid option used by one of my friends is <a href="http://lucene.apache.org/solr/" rel="noreferrer">Solr</a>, a search engine using the original Java-based Lucene. To use it with Rails, there\'s, of course an acts_as plugin, <a href="http://github.com/railsfreaks/acts_as_solr/tree/master" rel="noreferrer">acts_as_solr</a>.</p>\n\n<p>He presented the combo recently at <a href="http://www.montrealonrails.com/2008/08/20/10-was-a-success/" rel="noreferrer">Montreal on Rails</a> and gives a nice and thorough overview of <a href="http://hugofrappier.wordpress.com/2008/09/01/solr-presentation-at-montreal-on-rails/" rel="noreferrer">how to use acts_as_solr on his blog</a>.</p>\n\n<p>It apparently supports french accents very well, too.</p>\n'}, {'answer_id': 73903, 'author': 'user10864', 'author_id': 10864, 'author_profile': 'https://Stackoverflow.com/users/10864', 'pm_score': 0, 'selected': False, 'text': '<p>We\'re using <a href="http://hyperestraier.sourceforge.net/" rel="nofollow noreferrer">http://hyperestraier.sourceforge.net/</a>, which was inherited.  Haven\'t looked into other engines, but hyperestraier provides all the hooks necessary.  Setting up the search index is complicated though.  Probably easier options available.  </p>\n'}, {'answer_id': 79122, 'author': 'Brian Deterling', 'author_id': 14619, 'author_profile': 'https://Stackoverflow.com/users/14619', 'pm_score': 3, 'selected': False, 'text': "<p>I'm going through this exact process right now so while I don't have actual experience, I've spent many hours researching all the options.  Here's what I've learned so far:</p>\n\n<ul>\n<li>*Sphinx - good reputation for speed and functionality but Sphinx needs integer keys and my model uses GUID; ThinkingSphinx recently announced support for GeoSpatial </li>\n<li>Acts_As_Solr - recommended by a friend with a high-volume site; original creators have stopped working on it and documentation is hard to find; requires a Java servlet</li>\n<li>Acts_As_Ferret - looks easy to use, but lots of detractors that say its unstable</li>\n<li>Two others with limited information are Acts_As_Indexed and Acts_As_Searchable</li>\n</ul>\n\n<p>I have a spreadsheet with my attempt at documenting the advantages and disadvantages of all of them.  If anyone is interested in seeing it and/or helping me correct it, just contact me.  I'll post it somewhere once I know its accurate.</p>\n\n<p>My recommendation would be to try UltraSphinx or Thinking Sphinx if you have normal primary keys.  I'm going to try Acts_As_Xapian based on the good documentation, feature set, and how active the project seems to be.</p>\n"}, {'answer_id': 86590, 'author': 'Josh Schwartzman', 'author_id': 16447, 'author_profile': 'https://Stackoverflow.com/users/16447', 'pm_score': 1, 'selected': False, 'text': "<p>I'm using acts_as_ferret.  It's easy to configure and generally fast.  The built-in active record find functionality is quite useful: you can apply any conditions or join other models after your search finds the matching records. </p>\n\n<p>Unlike sphinx, you don't have to re-index ALL of your records when you add new data.  There are after_save and after_update hooks that will insert your new record into the ferret db.  This was one of the big selling points for me.</p>\n\n<p>When you do have to mass index your data, ferret is definitely slower than acts_as_sphinx (by a factor of 3).  I ended up writing my own method to re-index models which works as fast as sphinx -- it basically preloads all the data from the DB instead of going record by record to create the new index.</p>\n\n<p>The ferret documentation is good for the basics, but it's a bit sparse once you get into more complex searches, sorts and using a dRb server to host a remote index.  That being said, it feels a much more mature product than acts_as_sphinx, although I have limited experience with sphinx.</p>\n"}, {'answer_id': 121300, 'author': 'MattMcKnight', 'author_id': 8136, 'author_profile': 'https://Stackoverflow.com/users/8136', 'pm_score': 0, 'selected': False, 'text': "<p>It depends on what database you are using. I would recommend using Solr as it offers up a lot of nice options for fuzzy search and has a great query parser. The downside is you have to run a separate process for it. I have used Ferret as well, but found it to be less stable in terms of multi-threaded access to the index. I haven't tried Sphinx because it only works with MySQL and Postgres.</p>\n"}, {'answer_id': 439960, 'author': 'jshen', 'author_id': 46505, 'author_profile': 'https://Stackoverflow.com/users/46505', 'pm_score': 0, 'selected': False, 'text': "<p>I'm using a different option which was worked out amazingly well. I'm using jruby and talking to lucene directly. </p>\n\n<p>I've used acts_as_solr in the past and ran into some issues. mainly it makes a synchronous call for each AR save. This isn't too bad, but in my situation a save sometimes caused many synchronous calls to solr and would occasionally take longer than mongrel would allow and I'd get a mongrel timeout exception (or something like that)</p>\n"}, {'answer_id': 445769, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>Thinking Sphinx is a better alternative than Ultrasphinx, which seems abandoned, but, in general, Xapian has a more powerful engine than Sphinx and is easier for implementing realtime search.</p>\n'}, {'answer_id': 1351955, 'author': 'user116218', 'author_id': 116218, 'author_profile': 'https://Stackoverflow.com/users/116218', 'pm_score': 0, 'selected': False, 'text': '<p>I recommend acts_as_ferret. But though the tough part is to get it up and running successfully in your server, once done you hardly have any problem as ferret server will be running as separate background process to update your index every time there is any new update. Also, its working great in mongrel with apache for us.</p>\n'}, {'answer_id': 3049224, 'author': 'Pascal Lindelauf', 'author_id': 414376, 'author_profile': 'https://Stackoverflow.com/users/414376', 'pm_score': 0, 'selected': False, 'text': '<p>I\'ve been looking for the perfect solution as well. At first I went with Thinking Sphinx, which worked fine. But since I intent to host my webapp on <a href="http://www.heroku.com" rel="nofollow noreferrer">Heroku</a>, the only option is to use <a href="http://lucene.apache.org/solr/" rel="nofollow noreferrer">Solr</a>. The biggest drawback, however, is that development of the main <a href="http://github.com/railsfreaks/acts_as_solr" rel="nofollow noreferrer">acts_as_solr</a> gem seems to have stopped after May 2008. So that\'s too old for my taste. I just found <a href="http://outoftime.github.com/sunspot/" rel="nofollow noreferrer">Sunspot</a> as an advanced alternative and with recent updates, so that\'s one I\'m going to consider.</p>\n\n<p>Another option Heroku offers is to go for a hosted index server based on Solr, named <a href="http://www.websolr.com/" rel="nofollow noreferrer">Websolr</a>. The required gem <a href="http://github.com/onemorecloud/websolr-acts_as_solr" rel="nofollow noreferrer">websolr-acts_as_solr</a> is also luckily very much up-to-date. </p>\n'}, {'answer_id': 3618239, 'author': 'Leo', 'author_id': 436240, 'author_profile': 'https://Stackoverflow.com/users/436240', 'pm_score': 1, 'selected': False, 'text': "<p>If you are using a shared hosting service like me (Bluehost), your options may be limited to what the provider offers. In my case, I couldn't find a good and reliable way to start and keep a separate server running, such as Lucene or Solr.</p>\n\n<p>Therefore, I went with Xapian and it's been working well for me. There are 2 plugins for rails I've researched: acts_as_xapian and xapian_fu.\nThe first will get you going quickly, but it doesn't seem to be maintained anymore. I've just begun working with xapian_fu.</p>\n"}, {'answer_id': 28408790, 'author': 'udit mittal', 'author_id': 2116438, 'author_profile': 'https://Stackoverflow.com/users/2116438', 'pm_score': 1, 'selected': False, 'text': '<p>In case anyone is still interested, the latest thing to use now is <strong>elasticsearch</strong>. There are gems available for it like <strong>tire</strong> or <strong>elasticsearch-rails</strong>. It is also based on Lucene like Solr, Java-based. Solr is actually integrated with this project now... </p>\n'}]
['https://Stackoverflow.com/questions/73527', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9594/']