lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@apache.org>
Subject Re: Changing the scoring (newest doc date first)
Date Mon, 22 May 2006 22:54:24 GMT
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?

Cheers,

Doug

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message