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:[EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]