lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rob Staveley (Tom)" <>
Subject RE: Date ranges - getting the approach right
Date Sun, 16 Jul 2006 18:38:04 GMT
The second approach requires three hits, doesn't it?

(1) TermQuery on start date + sort on document ID
(2) TermQuery on end date + reverse sort on document ID
(3) The actual query with a filter on the above

Would that really be a saving?

-----Original Message-----
From: Erick Erickson [] 
Sent: 16 July 2006 15:03
Subject: Re: Date ranges - getting the approach right

Thanks for the clarification. Let me re-state this and see if I got it

1> if you never do any deletions (or recalculate your "special records"
after deletion/optimization), this could work as-is.

2> the safe way to do this would be to find the miniminum doc ID for the
start date, the maximum doc ID for the end date and make the filter by
flipping all the bits in the filter in between. Assuming that you indexed in
date-sorted order in the first place. There really can't be anything in the
system to do anything like this for you since it relies on the meta-data
that the mails were indexed in some specific order.

I actually like the second, it's less prone for getting out of whack.....

Thanks for the

View raw message