Forum: Ferret Scoring by field

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
C64e63b70be7dfed8b0742540b8b27e5?d=identicon&s=25 Mark James (Guest)
on 2006-01-13 08:33
(Received via mailing list)
Hello,

I've added a feature to Ferret that breaks down the score
of each matched document by the contribution from each of
the document's fields.

IndexSearcher now has a search_each_with_field_scores method,
and TopDocs has an each_with_field_scores method. Both yield
a third parameter, being a new score_by_field attribute of
ScoreDoc. score_by_field is a hash with field_name keys and
score values.

I find this useful when I have indexed a document by using a
separate field for each section of the document. The score
breakdown can be used to provide a user with not only a link
to each document in the search results, but to also a link to
the most relevant section of those documents.

Would this be something worthwhile to integrate into the Ferret
distribution? None of the high-level APIs are broken, though
scorers now return an array pair [score, score_by_field], rather
than just the score.
This topic is locked and can not be replied to.