Jens Krämer

Ferret / Rails demo project

 |  ferret, ruby, rails

Due to public demand I created a small ready to run Rails project to demonstrate the use of Ferret in a Rails context.

The acts_as_ferret mixin used in this sample project is based on the one I’m using in this Typo installation.

While at it, I made some improvements:

  • Non-existing index directories will be created on application initialization.
  • Index directories by default will be created in a directory structure like this: RAILS_ROOT/index/RAILS_ENV/ModelClassName. So the testing, development and production environments will each get their own ferret indexes.
  • Index searchers are kept open as long as the index doesn’t change - this should improve search performance especially with larger indexes.

Get the demo project including the acts_as_ferret plugin here