Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@www.apache.org Received: (qmail 22339 invoked from network); 4 Dec 2003 16:14:34 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 4 Dec 2003 16:14:34 -0000 Received: (qmail 53301 invoked by uid 500); 4 Dec 2003 16:14:23 -0000 Delivered-To: apmail-jakarta-lucene-user-archive@jakarta.apache.org Received: (qmail 53272 invoked by uid 500); 4 Dec 2003 16:14:23 -0000 Mailing-List: contact lucene-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Users List" Reply-To: "Lucene Users List" Delivered-To: mailing list lucene-user@jakarta.apache.org Received: (qmail 53252 invoked from network); 4 Dec 2003 16:14:22 -0000 Received: from unknown (HELO c000.snv.cp.net) (209.228.32.64) by daedalus.apache.org with SMTP; 4 Dec 2003 16:14:22 -0000 Received: (cpmta 3843 invoked from network); 4 Dec 2003 08:14:21 -0800 Received: from 128.143.171.233 (HELO ehatchersolutions.com) by smtp.hatcher.net (209.228.32.64) with SMTP; 4 Dec 2003 08:14:21 -0800 X-Sent: 4 Dec 2003 16:14:21 GMT Date: Thu, 4 Dec 2003 11:14:29 -0500 Subject: Re: DateFilter or RangeQuery Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v553) From: Erik Hatcher To: "Lucene Users List" Content-Transfer-Encoding: 7bit In-Reply-To: <49283633243.20031204171627@osua.de> Message-Id: X-Mailer: Apple Mail (2.553) X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N On Thursday, December 4, 2003, at 10:16 AM, Maxim Patramanskij wrote: > What is the better way to filter search results by date (which is one > of the indexed fields): > > - use RangeQuery against date field as a required part of boolean > query; > - use DateFilter > > First approach seems to be problematic since I have to extremely > increase maxClauseCount of BooleanQuery and run again extra memory > usage. DateFilter will be the better option if you do use the same date range filter repeatedly - just keep the instance around and re-use it. A more general question, though, is are you truly just representing dates? (and not timestamps) If so, how many different dates are in the index? If you are just using dates, I recommend using "YYYYMMDD" formatted Field.Keyword(String, String) fields. Don't use java.util.Date. You'll get far fewer terms if you are just representing dates, and RangeQuery might become a more viable option for you. Erik --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-user-help@jakarta.apache.org