Install BrokenCompass plugin
ruby script/plugin install http://brokencompass.googlecode.com/svn/trunkfrom inside of rails app root directory.
Add BrokenCompass configuration yml file
Add content like
sql: "select id,title,description,location from advertisments"
sql: "select id,content,dynamic_fields from queries"
# Database connection adapter
0. Nothing is optional in the yml(everything is mandatory)
1. Add as many items in index-sources as you want, but every item name should match model names(for which they will be used).
2. Make sure to include the Id field so that index created can be mapped to record identifier.
3. Provide the connection adapter details in connection_adapter section(so as to answer, where to read data from)
4. If you are not minding the spaces in yml(then you have messed up the configuration, so don't try to remove spaces :) from yml, wanna know more about yml? )
Run rake task to create indexes for the first time
rake brokencompass:create_indexfrom inside of rails app root directory.
Step: 04 (This is required, when one is re-creating the indexes from scratch)
Run rake task to re-create indexes
rake brokencompass:indexfrom inside of rails app root directory.
Step: 05 (To delete any of the indexes so created, delete corresponding "xxxx.index" file from broken_compass
from inside of rails app root directory.