On Fri, Mar 09, 2007 at 05:06:08AM +0100, Ben wrote:
I get back the correct results when I do Link.find_by_contents, however,
I’d like to highlight them.
If I do something like iterate through the list of results and call
result.highlight(“myquery”, :field => :description), but this is
returning nil for each result. How is this possible if these results are
correctly returned because “myquery” is a token in their description? Am
I incorrectly using the api?
your usage of the api is perfectly right. I’m not sure what’s going on
there, and can’t reproduce this here.
To help debug this a bit, could you please try this in the console:
results = Link.find_by_contents(query)
result = results.first
result.highlight(query, :field => :description) # returns nil
doc_num = result.document_number
if you are on aaf trunk:
Link.aaf_index.ferret_index.highlight(query, doc_num, :field =>
if on aaf stable:
Link.ferret_index.highlight(query, doc_num, :field => :description)
this would directly use ferret’s highlight method. Btw, what version of
aaf do you use?
webit! Gesellschaft für neue Medien mbH
Schnorrstraße 76 | 01069 Dresden
Telefon +49 351 46766-0 | Telefax +49 351 46766-66
[email protected] | www.webit.de
Amtsgericht Dresden | HRB 15422
GF Sven Haubold, Hagen Malessa