-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: How to boost by 'more recent' date
PostPosted: Thu Jan 24, 2008 10:49 am 
Newbie

Joined: Tue Oct 09, 2007 4:48 am
Posts: 11
Hi,

I am trying to find out if it is possible to apply a boost (or perhaps there is some other mechanism) to a hibernate search such that more 'recent' results have a greater score (importance) than older ones.

I appreciate that I can do date ranged searches, and that I can easily just sort the results by date, but I am aiming for something more sophisticated than that.

Ideally I would like to apply just a small boost to weight the results slightly towards the more recent - meaning that it is not impossible for a very old result to be at the top of the list - just that the old result would have to be more relevant than than another, more recent, result.

I hope I've explained my question properly - I appreciate any suggestions you may have.

Thanks,

James.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 24, 2008 3:31 pm 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
I think in your case boosting a field is not what you want. Boosting at indexing or query time will increase the relevance of a match within this field in relation to other fields. Hence boosting really only makes sense in a multi field (term) query.

What is wrong with a sorting the results by date? Why is this not sophisticated enough ;-) ?

you also have to consider that a boost factor is a constant value you apply once at indexing time. You could boost your date field and just keep increasing the value so that new entries get as higher boost factor. But what happens at a overflow? Alternatively you could at each new addition calculate a max boost factor for the latest entry and then reindex all your data giving each entry a somehow lower boost factor than your calculated max boost. Both options don't seem to be too sophisticated.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 24, 2008 5:15 pm 
Expert
Expert

Joined: Mon Nov 26, 2007 2:29 pm
Posts: 443
Using ehcache with an eviction policy of LRU (least recently used, which I believe it's the default) would achieve just that.

_________________
Gonzalo Díaz


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.