Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 14844 invoked from network); 9 Mar 2005 02:53:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 9 Mar 2005 02:53:55 -0000 Received: (qmail 7508 invoked by uid 500); 9 Mar 2005 02:53:52 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 7480 invoked by uid 500); 9 Mar 2005 02:53:52 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 7467 invoked by uid 99); 9 Mar 2005 02:53:52 -0000 X-ASF-Spam-Status: No, hits=2.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,FORGED_YAHOO_RCVD X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from web31109.mail.mud.yahoo.com (HELO web31109.mail.mud.yahoo.com) (68.142.200.42) by apache.org (qpsmtpd/0.28) with SMTP; Tue, 08 Mar 2005 18:53:50 -0800 Received: (qmail 35488 invoked by uid 60001); 9 Mar 2005 02:53:48 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=mYkt3LmSk3lwv2TMQe77wGMXDEqow7dbnabYZ6upqTJvsxz2MZ08VRVTM5M0IdYMDbrP9ycyJvJeG8Cy0fUZccMONQHFkoSmZ1XboBvTMR1Y6ETFmE0ziKPp3mAszcdO1Flgam2eb+B06kG/3yuqUkSttLtj0qgKTDDJ4tOExOc= ; Message-ID: <20050309025348.35486.qmail@web31109.mail.mud.yahoo.com> Received: from [69.201.130.90] by web31109.mail.mud.yahoo.com via HTTP; Tue, 08 Mar 2005 18:53:48 PST Date: Tue, 8 Mar 2005 18:53:48 -0800 (PST) From: Otis Gospodnetic Subject: Re: Assorted questions To: java-user@lucene.apache.org In-Reply-To: 6667 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Your memory is serving you well. http://www.lucenebook.com/search?query=%22range+query%22+performance Note the hit in section 6.5.1 - the fact that we used range queries in the performance section is an indicator that one can really mess things up if using range queries injudiciously. :) In particular, the typical advice is to try to round the time information, to avoid costly range queries. Seconds sound like trouble. Otis --- Scott Smith wrote: > I needed to return my hits list in date/time order (instead of > relevancy). So, I implemented a class that converted dates to an int > and stored the integer as a field in my index. I passed a Sort > object > to the IndexSearcher (indicating that the sort field was convertible > to > int) to get things back in date/time order. It works great. > > > > Now I need to do a search within a date/time range (e.g., all the > documents between 1/1/2005 00:00:00 to 1/5/2005 23:59:59). It > appears > that there is no way to use the integer date to do the range search > since Lucene is really looking at the string representation of the > int. > Even prefixing enough zeros to make all of the integers the same > length > doesn't help (darn negative numbers). > > > > Have I missed something? Or, will I need to put some kind of > date/time > string that looks like "20050308172533" (for 3/8/2005 17:25:33) in > the > index? > > > > My second question is whether range searches are efficient? I seem > to > recall reading somewhere that range searches get converted to a list > of > the individual items. Since a day has 86,400 seconds, a few days > worth > of searching would require a very large list. Please tell me that > I'm > out-in-the-weeds on my recall and that range searches are efficient > (i.e., it's effectively just doing a string compare with the start > and > end terms). > > > > Scott > > > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org