lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Willnauer <>
Subject Re: Boost more recent document
Date Wed, 30 Nov 2011 21:02:09 GMT
If you use LogMergePolicy ie. do merges in order you could use the
absolute docID as a relative age value. Smaller docIDs mean younger
documents. Maybe this works for you?


On Wed, Nov 30, 2011 at 9:08 PM, Zhang, Lisheng
<> wrote:
> Thanks very much for your helps! I got the point, only problem is that
> I cannot afford to to use FieldCache because in our app we have many
> lucene index data folders, is there another simple way?
> Thanks again, Lisheng
> -----Original Message-----
> From: Simon Willnauer []
> Sent: Wednesday, November 30, 2011 11:40 AM
> To:
> Subject: Re: Boost more recent document
> On Wed, Nov 30, 2011 at 6:59 PM, Zhang, Lisheng
> <> wrote:
>> Hi,
>> We need to boost document which is more recent (each doc has time stamp attribute).
It seems that
>> we cannot use doc boost at index time because it will be condensed into one byte
(cannot differentiate
>> 365 days), so we may use payload (save time stamp as payload) to boost at search
>> In our app we let user enter query at browser and use QueryParser to generate query,
the query can
>> be different types (TermQuery, BooleanQuery, WildcardQuery, ...), then it seems we
need to create
>> each customized query class similar to PayloadTermQuery, is there another simpler
> you can simply index your timestamp (untokenzied) and wrap your query
> in a CustomScoreQuery. This query accepts your user query and a
> ValueSource. During search CustomScoreQuery calls your valuesource for
> each document that the user query scores and multiplies the result of
> the ValueSource into the score. Inside your valuesource you can simply
> get the timestamps from the FieldCache and calculate your custom
> boost...
> hope that helps
> simon
>> Thanks very much for helps, Lisheng
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message