lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otis Gospodnetic <otis_gospodne...@yahoo.com>
Subject Re: Advanced timestamp usage (or global value storage)
Date Wed, 25 Aug 2004 15:54:42 GMT
The more documents match, the slower the search; how long your
particular search would take I cannot tell, though - you should just
test it out and see.

I never needed to use the trick with a flag field in all documents, but
I know others do it.

Otis

--- Avi Drissman <avi_drissman@baseview.com> wrote:

> 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
> 
> 


---------------------------------------------------------------------
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