Adjusting scores

One other mod to Ferret I’ve found useful is to add
the following line at the top of the each_hit() block

  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).

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


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs