Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 46701 invoked from network); 2 May 2005 22:10:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 May 2005 22:10:57 -0000 Received: (qmail 57431 invoked by uid 500); 2 May 2005 22:12:23 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 57394 invoked by uid 500); 2 May 2005 22:12:22 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 57377 invoked by uid 99); 2 May 2005 22:12:22 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=FORGED_RCVD_HELO X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from smtp-vbr6.xs4all.nl (HELO smtp-vbr6.xs4all.nl) (194.109.24.26) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 02 May 2005 15:12:22 -0700 Received: from k8l.lan (porta.xs4all.nl [80.127.24.69]) by smtp-vbr6.xs4all.nl (8.12.11/8.12.11) with ESMTP id j42MAlUe023378 for ; Tue, 3 May 2005 00:10:47 +0200 (CEST) (envelope-from paul.elschot@xs4all.nl) From: Paul Elschot To: java-dev@lucene.apache.org Subject: Re: [Performance] Streaming main memory indexing of single strings Date: Tue, 3 May 2005 00:10:47 +0200 User-Agent: KMail/1.5.4 References: <950FF7DE40C2B64CAF80B564732927E1039E71E2@exchange.be.bvd> <200505022332.41691.paul.elschot@xs4all.nl> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200505030010.47183.paul.elschot@xs4all.nl> X-Virus-Scanned: by XS4ALL Virus Scanner X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On Monday 02 May 2005 23:38, Wolfgang Hoschek wrote: > > Yes, the svn trunk uses skipTo more often than 1.4.3. > > > > However, your implementation of skipTo() needs some improvement. > > See the javadoc of skipTo of class Scorer: > > > > http://lucene.apache.org/java/docs/api/org/apache/lucene/search/ > > Scorer.html#skipTo(int) > > What's wrong with the version I sent? Remeber that there can be at most > one document in a MemoryIndex. So the "target" parameter can safely be > ignored, as far as I can see. Correct, I did not realize that there is only a single doc in the index. > > > > > In case the underlying scorers provide skipTo() it's even better to > > use that. > > > > The version I sent returns in O(1), if performance was your concern. Or > did you mean something else? Since 0 is the only document number in the index, a return target == 0; might be nice for skipTo(). It doesn't really help performance, though, and the next() works just as well. Regards, Paul Elschot. --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org