acts_as_ferret problems

On one of our client's site, we’ve been using the [acts_as_ferret]:(http://projects.jkraemer.net/acts_as_ferret/) plugin for about six months. The site was running on OS X server and everything was working great. Search was blazingly fast and record insert and update were acceptable. Everything was wonderful. Until we moved to Linux.

Last week, we stood the site up on a linux server to get ready for our move to a new datacenter. The site was easy to set up and is now running mongrel and apache mod_proxy_balancer. Everything was going well until we got an error saying:

StandardError (: Error occured at <analysis.c>:701
Error: exception 2 not handled: Error decoding input string. Check that you have the locale set correctly
):

A little bit of googling pointed me to an explanation for the error. I spent about three hours trying various combinations of LANG settings to no avail. I upgraded and downgraded both ferret and the plugin. Nothing helped.

Finally, I found an unrelated [message]:(http://rubyforge.org/pipermail/ferret-talk/2006-July.txt) that talked about switching from cFerret to rFerret. I gave it a shot by changing the require in init.rb from ferret to rferret. That did it. It now takes about 30 times as long to index the pages, and searching went from instantaneous to taking about 1 second. I would certainly prefer things to be faster, but at least they work.

So, long story short, if you have errors in ferret, try switching to the pure ruby version. This is a great example of the problems with really complex software. Ferret is a wonderful program when it works, but when it doesn’t it can be a complete pain!