Adjusting scores


#1

One other mod to Ferret I’ve found useful is to add
the following line at the top of the each_hit() block
in Search::IndexSearcher.search:

  score = yield( doc, score ) if block_given?

This allows a block attached to a search call to adjust
document scores before documents are sorted, based on
some (possibly dynamic) numerical factors associated
with the document, e.g. the number and importance of
incoming links to the document (Google’s PageRank).


#2

Thanks Mark. Keep these ideas coming. I’ll be considering them all for
the next version of Ferret.

Dave