lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcus Falck" <marcus.fa...@observer.se>
Subject RE: Changing the scoring (newest doc date first)
Date Tue, 23 May 2006 08:21:06 GMT
Hmm.
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.
 
/
Marcus

________________________________

From: Doug Cutting [mailto:cutting@apache.org]
Sent: Tue 5/23/2006 12:54 AM
To: java-user@lucene.apache.org
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? 

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