Robert H. wrote:
I’ve implemented a field_scores hash that can be returned along with
each document and aggregate score. It’s only currently working in
Could you please give a code example of how to do a query and get the
I have Ferret 0.11.6.
Rob, FerretResult objects are given a ferret_field_scores attribute,
which is an array (not a hash, as I said above) of field_score objects,
in order of decreasing score. Field_score objects have “field” and
You specify which fields you want to see the field scores for by adding
the field_info option :field_score => :yes.
You can use field_scores to display an extract of the field that best
matches the user’s query:
@result.highlight @query, :field =>
It’d take some work to port it to Ferret 0.11.6, though I will do