Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 38934 invoked from network); 12 Oct 2006 19:59:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 12 Oct 2006 19:59:30 -0000 Received: (qmail 34853 invoked by uid 500); 12 Oct 2006 19:59:23 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 34807 invoked by uid 500); 12 Oct 2006 19:59:22 -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 34796 invoked by uid 99); 12 Oct 2006 19:59:22 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Oct 2006 12:59:22 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [69.55.225.129] (HELO ehatchersolutions.com) (69.55.225.129) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Oct 2006 12:59:21 -0700 Received: by ehatchersolutions.com (Postfix, from userid 504) id 2A7E130EFC17; Thu, 12 Oct 2006 15:59:00 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on javelina X-Spam-Level: Received: from [10.0.1.2] (va-71-53-203-135.dhcp.embarqhsd.net [71.53.203.135]) by ehatchersolutions.com (Postfix) with ESMTP id 0194530EFC17 for ; Thu, 12 Oct 2006 15:58:53 -0400 (EDT) Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: <20061012190442.1913.qmail@web81703.mail.mud.yahoo.com> References: <20061012190442.1913.qmail@web81703.mail.mud.yahoo.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Erik Hatcher Subject: Re: Avoiding sort by date Date: Thu, 12 Oct 2006 15:58:50 -0400 To: java-user@lucene.apache.org X-Mailer: Apple Mail (2.752.3) X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_00, RCVD_IN_SORBS_DUL autolearn=no version=3.1.1 X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N You really should be using the same IndexSearcher for successive searches. Sorting works best when done with a "warm" searcher. Have a look at Solr's warming strategy, and consider adopting that in some way. Erik On Oct 12, 2006, at 3:04 PM, wrote: > Hi folks, > > I am using Lucene 2.0 > > In our application, I am indexing a stream of documents. Each > document is fairly small (< 1 KB), but there can be 10's of > millions of documents. Each document has a Timestamp field. Users > can enter free-form searches and a date/time range. They are most > interested in the most recent documents (as indicated in the > Timestamp field). An obvious way to do achieve this is to > searcher = new IndexSearcher(indexDir); > RangeFilter rf = new RangeFilter("day", start, end, true, true); > hits = searcher.search(query,rf,new Sort(new SortField[]{ > new SortField > ("timestamp",SortField.STRING,true )})); > > Depending on the query, there may be millions of hits results. If > the same query is executed several times in quick succession, the > heap quickly runs out of memory. I suspect that this is because > Lucene needs to load all the millions of hits in order to sort the > results. > > My idea is to avoid the Sort() entirely. Is there a way, during > indexing (or by setting Weights inside the query) to automatically > set the score for more recent documents higher? > > Thanks > -- > Solidguy > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org