I’m trying to highlight keyword snippets using the highlight method of
the results returned from find_by_contents (the actual models), but
always come up with an empty array. Any ideas what could be going wrong?
Have you defined the field(s) as storable?
Link to FieldInfo class:
http://ferret.davebalmain.com/api/classes/Ferret/Index/FieldInfo.html
You need to set up your fields with acts_as_ferret. This is how I have
mine setup (still learning Ferret and AAF so may not be totally correct
but highlighting works):
acts_as_ferret( :fields => {
 :name => {},
 :desc => {},
 :body => {:store => :yes},
 :role => {},
})
This allows me to use the highlighting with the “body” field. The other
ones still can’t highlight.
Curtis
----- Original Message -----
From: Britt S. [email protected]
Date: Thursday, November 2, 2006 13:57
Subject: [Ferret-talk] highlighting with find_by_contents
To: [email protected]
Thanks Curtis and Jens. That worked great (after rebuilding index)!
Britt