Text Search for Rails 3 on Heroku - Texticle vs acts_as_tsearch vs acts_as_indexed
Asked Answered
W

4

9

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:

Texticle

acts_as_tsearch

acts_as_indexed

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!

White answered 19/4, 2011 at 10:11 Comment(5)
I can only really comment on acts_as_indexed as I am the developer of it. In terms of scaling, AAI never achieves consistency with more than one Heroku Dyno, since they do not have a shared filesystem. This has not been a problem for most people, but could be an issue in certain situations. If you want real scalability on Heroku then IndexTank and WebSolr are the way to go.Carton
Thanks Douglas for your response. Is it possible that I use acts_as_indexed to begin with? When I want my application to scale, I switch to IndexTank or WebSolr?White
Yes, this is what I normally recommend to people.Carton
Haven't tried the rest, but I use Websolr and it's working good. They had few minor issues every now and then, but it seems to becoming more solid.Buff
Might be worth considering IndexTank or WebSolr if your search requirements are more than just text. IndexTank for instance allows you to add parameters to the index so you can do things like geolocate your search results. If it's just text search, then I guess any postgres FullTextSearch would probably be fine.Sfax
L
12

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.

Lour answered 30/11, 2011 at 17:11 Comment(0)
P
1

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.

Philosophism answered 8/12, 2014 at 12:37 Comment(0)
O
0

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.

Oleate answered 5/10, 2011 at 16:26 Comment(0)
P
0

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.

Premature answered 27/11, 2011 at 19:57 Comment(1)
Indextank link is no longer operational, i also cannot find IndexTank in Heroku addons list, did they take it down, or did they change their name? I also do not seem able to reach their website.Xerox

© 2022 - 2024 — McMap. All rights reserved.