You can utilize the CustomScoreQuery introduced in Lucene 2.2 to provide this type of functionality. This is quite straight forward to do and works really well. Since "recentness" is a function of the time the search was made, we store the appropriate date in an index field and use a CustomScoreQuery to effect changes to the score based on the current date. Works like a champ.
-tree On Jan 3, 2008 2:33 PM, <[EMAIL PROTECTED]> wrote: > IMHO it would be nice if Lucene's Similarity formula took the > indexed-date of the document into account. Ideally as an optional > setting, where the user can provide a date field as well. > > Some of the other search engines do - for example Fast's Instream. It > makes sense that as documents age over time, they are less important > than the new ones. > > Is JIRA the mechanism where you can add "feature requests" for Lucene? > > > -----Original Message----- > From: Dominik Bruhn [mailto:[EMAIL PROTECTED] > Sent: Sunday, December 30, 2007 4:38 AM > To: java-user@lucene.apache.org > Subject: Re: Prioiritze new documents > > Hy, > a solution came into my mind: > Every document gets boosted by a integer which I increment each time I > add a new document to the index. So the newer documents should get a > bigger boost than the older ones. > > I tried it out and ran into a problem: > Although I set the Boost via doc.setBoost(value) for each document > before writing it to the index it doesnt change anything. Even worse if > I look at the index using Luke (Version 0.7.1) each document got a boost > of 1 not of the value supplied. > > Who can help me? > > Thanks > -- > Dominik Bruhn > mailto: [EMAIL PROTECTED] > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Tom Emerson [EMAIL PROTECTED] http://www.dreamersrealm.net/~tree