lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Avi Drissman <avi_driss...@baseview.com>
Subject Re: Advanced timestamp usage (or global value storage)
Date Wed, 25 Aug 2004 15:50:01 GMT
On Aug 25, 2004, at 11:39 AM, Bernhard Messer wrote:

> If you already store the date time when the doc was index, you could 
> use the following trick to get the last document added to the index:
>
>            while (--maxDoc > 0) {

Yes, but that's a linear search :(

On Aug 25, 2004, at 11:25 AM, Otis Gospodnetic wrote:

> What if all Documents in your index contained some flag field + an 'add
> date' field.  Then you could make a query such as: flag:1 and sort it
> by 'add date' field, taking only the very first hit as the most
> recently added Document.

That's a very clever approach. I'm currently using Lucene 1.3, so I 
hadn't thought about using the new sorting abilities. I'd need to move 
to 1.4, of course.

A question, though: how efficient is it to make a query that matches 
all documents and then sort it? I'm looking for something as small as I 
can; after all, storing the last date in a file separate from the index 
is O(1)...

Thanks!

Avi

-- 
Avi 'rlwimi' Drissman
avi@baseview.com
Argh! This darn mail server is trunca


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


Mime
View raw message