lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcus Falck" <>
Subject RE: Changing the scoring (newest doc date first)
Date Tue, 23 May 2006 08:21:06 GMT
Not sure that I understand exactly what you mean.
Doesn't your solution require me to add all documents in correct date range?
Since I will index articles from different systems I can't guarantee that all articles will
be added to the index in correct date order.


From: Doug Cutting []
Sent: Tue 5/23/2006 12:54 AM
Subject: Re: Changing the scoring (newest doc date first)

Marcus Falck wrote: 
> There is however one LARGE problem that we have run into. All search result should be
displayed sorted with the newest document at top. We tried to accomplish this using Lucene's
sort capabilites but quickly ran into large performance bottlenecks. So i figured since the
default sort is by relevance i would like to change the relevance so that we don't even need
to sort the documents. I guess alot of people at this mail list can give me valuable hints
about how to accomplish this! 

> (Since i now about the ability to sort by index id (which i haven't tried) I can also
add that i can't guarantee that all documents will be added in correct date order (remember
the several systems,  the future plans is to buy content from different actors on the market
and index it up).

A HitCollector should help.  Matching documents are passed to a 
HitCollector in the order they were added to the index.  So if newer 
documents were added to your index later, then the newest N documents 
are simply the last N documents passed to the HitCollector. 

Could that work? 



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

View raw message