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 [mailto:[EMAIL PROTECTED] Sent: 16 July 2006 15:03 To: java-user@lucene.apache.org Subject: Re: Date ranges - getting the approach right Thanks for the clarification. Let me re-state this and see if I got it right. 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 Erick
smime.p7s
Description: S/MIME cryptographic signature