Forum: Ferret Balancing relevancy and recentness

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.
Ben L. (Guest)
on 2006-01-22 02:31
I was wondering if there was a good way to either balance the relevancy
score with recentness  of matching documents- or include the recentness
in the score somehow?

Thanks,
Ben
David B. (Guest)
on 2006-01-22 03:12
(Received via mailing list)
Hi Ben,

Currently there is no way to do this. You can easily sort by the age
of the document but to score by the age of the document is not
possible without making a change to Ferret. Mark J. came up with
this idea recently;

> 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

With this change you'd be able to modify the score based on the age of
the document. Hope that helps.

Cheers,
Dave
Erik H. (Guest)
on 2006-01-23 03:39
(Received via mailing list)
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.   Right, Dave?

For a real-world example of this, look at TheServerSide case study in
"Lucene in Action" and online here:

	<http://www.theserverside.com/articles/article.tss?...

(search for "boost" to hone in on the specific topic)

	Erik
David B. (Guest)
on 2006-01-25 04:07
(Received via mailing list)
On 1/23/06, Erik H. <removed_email_address@domain.invalid> wrote:
> 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.   Right, Dave?

Sorry for the slow reply. Sure you could do this. Ferret handles
boosts in exactly the same way.
This topic is locked and can not be replied to.