Welcome Guest | Login

Ferret: Index location, re-indexing

I am using the acts_as_ferret plugin. Does anyone know the location of the ferret indexes? How do I re-index ferret for my app? in dev mode, the easiest way is to delete the index directory and ferret knows to rebuild the index.

TIA for your help
Sat (RoR noob)

2007-06-30 03:45 PM

RoR Noob
Your indexes will show up in RAILS_ROOT/index/production.  If they do not, check your read/write permissions to make sure your fcgi/mongrel processes can write to the appropriate directory.  (It helps to make sure the directory already exists before you start the server).

Second, if you are using more than one mongrel process, please read the blog post below for info about running ferret as a DRb process to avoid concurrency issues:
http://www.subelsky.com/2007/03/pitfalls-of-actsasferret-with-drbserver.html

2007-06-30 03:55 PM

I dont see rails_root/index/production but acts_as_ferret is working, my app is searching correctly. FYI, i use capistrano to deploy so I am assuming RAILS_ROOT is the "current" directory in the cap dir structure.

2007-06-30 04:02 PM

RoR Noob
Sorry, my bad, was looking in the wrong place. Thanks a lot

2007-06-30 04:08 PM

RoR Noob
I've just moved one of my accounts to a mongrel cluster.  Everything seems to be going well except for the whole ferret indexing issue.

I've read the above article, but how do I set up my hostingrails account so that I can have the ferret server running on a subdomain of my site on the suggested port?

2007-07-24 04:38 PM

Aaronh - Since you chose to run this app on mongrel cluster, I hope the article link given below could help getting your ferret server up.

http://www.subelsky.com/2007/03/pitfalls-of-actsasferret-with-drbserver.html

2007-07-24 06:04 PM

I read the link, but to make it work it tells you to setup a ferret drb running on a particular port and subdomain (ferret.domain.com:9009, for example).  That is the bit I don't quite know how to do.

2007-07-24 06:47 PM

You may try using the port xxxx9 where "xxxx" is your assigned mongrel port on the server.

2007-07-24 07:29 PM

Thanks, Varun.  I did that, but I'm not sure how to verify that ferret is now running via the DRb.  Is there a way to check this?

2007-08-15 06:48 PM

You can just watch 'top' in your shell and confirm that the Drb process is indeed taking CPU when you search.  If you have the configuration set to your port then it should be running there no problem, but let us know if it isn't.  

2007-08-16 04:41 AM

Thanks for the help William.

I had a lot of trouble figuring out how to get the ferret_server to actually start, but it looks as though it is working.  It appears that the log/ferret_server.log file is updated with every query sent via the server.  Right now, it appears to be OK.

I figured I should put the stuff I discovered in this thread so that other people could get their ferrets up and running as well.

For my Capistrano 2 deployed, mongrel cluster driven app the magical command turned out to be:

cd /home/HRUSER/apps/APPNAME/current && FERRET_USE_LOCAL_INDEX=1 script/runner -e production vendor/plugins/acts_as_ferret/script/ferret_start
That started the server running.  I just added the same code to my crontab to run @reboot (just like the mongrel servers) as well as my Capfile deployment script and it all seems to be hunky dory.  *knocks wood*

Thanks again for all of the help.  HostingRails constantly impresses.

2007-08-16 05:56 PM


Hello Guest! In order to post you must be an active client with us, please log in or sign up.