I’m using ferret to index various objects and i’m create a
Ferret::Document for each of these objects. Indexing and searching is
Each of these Ferret::Documents has a ‘relevance’ field, storing an
integer, how relevant this object is for the search. The ‘relevance’ is
in the range of 1…10
Now i would like to multiply the relevance of the document with the
score, and sort the results by that.
A document with a score of 0.82 and a relevance of 3 should have a final
score of 2.46
I couldn’t figure out how to do this …
I’ve read the ‘Balancing relevancy and recentness’ thread…
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
i guess this works for the pure ruby implementation but won’t work for
As long as Ferret does what Lucene does with boosts, you could scale
document boosts at indexing time by some factor related to age and
that will factor into scoring.
Boost won’t help me here, i’ve even set the boost value for relevance to
0.0, as it should not be part of the query…
Is there any way on how to recaluclate the score?