Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@www.apache.org Received: (qmail 31567 invoked from network); 4 Dec 2003 16:34:24 -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:34:24 -0000 Received: (qmail 92677 invoked by uid 500); 4 Dec 2003 16:34:13 -0000 Delivered-To: apmail-jakarta-lucene-user-archive@jakarta.apache.org Received: (qmail 92645 invoked by uid 500); 4 Dec 2003 16:34:12 -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 92630 invoked from network); 4 Dec 2003 16:34:12 -0000 Received: from unknown (HELO p15105029.pureserver.info) (217.160.131.136) by daedalus.apache.org with SMTP; 4 Dec 2003 16:34:12 -0000 Received: (qmail 23119 invoked by uid 89); 4 Dec 2003 17:34:13 +0100 Received: from unknown (HELO max.osuatech.local) (max%osua.de@212.9.251.158) by 0 with SMTP; 4 Dec 2003 17:34:13 +0100 Date: Thu, 4 Dec 2003 18:34:11 +0200 From: Maxim Patramanskij X-Mailer: The Bat! (v1.62i) Business Reply-To: Maxim Patramanskij Organization: OSUA technology X-Priority: 3 (Normal) Message-ID: <62288298170.20031204183411@osua.de> To: "Lucene Users List" Subject: Re[2]: DateFilter or RangeQuery In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 Erik, thanx a lot for your suggestion. Dates currently used in the following way: doc.add(Field.Keyword(FIELD_KEYWORD_MODIFIED, DateField.timeToString(docEnum.getLastModified()))); where is docEnum.getLastModified() is a file.lastModified()(i.e. timestamp). An index can contain up to 10000, so up to 10000 timestamps are possible(and boolean query, thus, can contain that much clauses...wow!). Yeah, it does not really needed to store timestamps and thus I can really use your suggestion about "YYYYMMDD" date format, cause I don't need more precise file dates. Max. EH> 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. EH> DateFilter will be the better option if you do use the same date range EH> filter repeatedly - just keep the instance around and re-use it. EH> A more general question, though, is are you truly just representing EH> dates? (and not timestamps) If so, how many different dates are in the EH> index? EH> If you are just using dates, I recommend using "YYYYMMDD" formatted EH> Field.Keyword(String, String) fields. Don't use java.util.Date. EH> You'll get far fewer terms if you are just representing dates, and EH> RangeQuery might become a more viable option for you. EH> Erik EH> --------------------------------------------------------------------- EH> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org EH> 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