Craig Jolicoeur wrote: > I have a rails app that is going to be deployed across several servers. > > In my understanding of acts_as_ferret, the index files are kept in the > index folder in the root of the rails app. This won't work for multiple > servers, of course, since all the servers will have their own directory > tree. > > How are people using ferret for apps deployed on multiple servers? > Could I run the index files through the database much like I do with > session info to prevent this problem? Or is there a completely > different work around that I am just not thinking of?
As others have already mentioned, you need to make sure the index writer is a singleton instance with all other servers as clients. It is a fun problem if you want to write it yourself and are familiar with DRb (quick to learn) and threading/locking issues. However if you don't want to spend the time to do that yourself I would highly suggest looking into the Searchable plugin which uses Ferret or Solr as search backends. It integrates nicely into your models using ActiveRecord hooks - much like aaf. The key feature in your case is that it also provides a DRb backend which you can turn on by a simple config switch, allowing you to have a central indexing server. more about this plugin at RubyForge: http://searchable.rubyforge.org/ It has been mentioned once before on this list but I think it deserves more exposure - especially as more people try to use Ferret for larger projects which require a multiple-server deployment. My company wrote our own DRb ferret implementation in house -- but that was before I saw the Searchable rails plugin ;) Good Luck, -damian -- Posted via http://www.ruby-forum.com/. _______________________________________________ Ferret-talk mailing list [email protected] http://rubyforge.org/mailman/listinfo/ferret-talk

