Reputation: 689
I am building a Rails 3 application that will be hosted on Heroku.
To implement full text search, these are the free alternatives that I have come across:
My application is going to be data intensive with a lot of read and writes. Search is also going to be used a lot.
Search is going to be across different models.
Which one will be the best in terms of performance and scaling?
Are there any other free and better alternatives?
Is it better to go for a IndexTank or WebSolr (that Heroku recommends) instead?
Thanks in advance!
Upvotes: 9
Views: 2489
Reputation: 21
You can use PostgreSQL's built-in full text search, but it's a pain, but there are gems such as pg_search to make it a lot easier, but that one has some serious problems, but I've figured out easy workarounds. See https://docs.google.com/presentation/d/1NbN0kJMJsSQW2N7ItNMB6VuM_lJok-Xb0epk0anbRIo (slides from my lightning talk titled "Full Text Search on Heroku for FREE") for details.
Upvotes: 1
Reputation: 123
Have you tried PgSearch https://github.com/Casecommons/pg_search? Since heroku uses pg, you actually get full text search for free, and PgSearch builds named scopes that take advantage of PostgreSQL’s full text search.
Upvotes: 12
Reputation: 12679
Heroku recommends using an add-on to provide full-text search. This provides you with the best performance, scalability, and ease-of-use for your application. There are two add-ons for full text search: IndexTank and Websolr.
Upvotes: 0
Reputation: 19466
I would recommend using WebSolr. It is an enterprise level search system based on Apache Solr, which can handle millions of indexed documents without breaking a sweat. Furthermore, Solr allows you to define a bespoke structure to you data, rather than forcing you down the line of a simple FULLTEXT search. It offers extra features such as faceted searching and spelling correction.
If you do not want to pay for Solr, you can host it yourself, as it is open source: http://lucene.apache.org/solr/
With regards to the alternatives you mentioned, if you are doing a substantial amount of searching, I would not use anything that relies on your application database to do fulltext search- that is a very amateur solution which does not scale.
Upvotes: 0