Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@apache.org Received: (qmail 7966 invoked from network); 1 May 2003 00:39:23 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 1 May 2003 00:39:23 -0000 Received: (qmail 16603 invoked by uid 97); 1 May 2003 00:41:28 -0000 Delivered-To: qmlist-jakarta-archive-lucene-user@nagoya.betaversion.org Received: (qmail 16596 invoked from network); 1 May 2003 00:41:27 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 1 May 2003 00:41:27 -0000 Received: (qmail 7279 invoked by uid 500); 1 May 2003 00:39:13 -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 7265 invoked from network); 1 May 2003 00:39:12 -0000 Received: from web12707.mail.yahoo.com (216.136.173.244) by daedalus.apache.org with SMTP; 1 May 2003 00:39:12 -0000 Message-ID: <20030501003921.26019.qmail@web12707.mail.yahoo.com> Received: from [24.90.65.225] by web12707.mail.yahoo.com via HTTP; Wed, 30 Apr 2003 17:39:21 PDT Date: Wed, 30 Apr 2003 17:39:21 -0700 (PDT) From: Otis Gospodnetic Subject: Re: Bug in TestPhrasePrefixQuery in 2003.04.21 Build? To: Lucene Users List In-Reply-To: <056301c308fb$03bfc9a0$6422a8c0@medined01> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hello, Yes, that is a bug. Good eyes! The fix is coming. Otis --- David Medinets wrote: > The TestPhrasePrefixQuery looks like it is searching for "blueberry > pi*" and it even seems to work at first glance. However, the test > data is not extensive enough to show what is really happening. > > The searching technique implemented in TestPhrasePrefixQuery will > find not only "blueberry pie" but also "blueberry strudel" if both > exist in the documents. > > The reason is that the IndexReader.terms(Term termToMatch) method > looks for the first term equal or larger than termToMatch and then > returns *all* terms from that point in the index to the end. > > One potential solution might be something like the following: > String pattern = "pi*"; > TermEnum te = ir.terms(new Term("body", pattern)); > while (te.term().text().matches(pattern)) { > termsWithPrefix.add(te.term()); > if (te.next() == false) > break; > } > } > > Of course, the code above only works with JDK1.4 because of the > pattern matching. > > Comments? > > David Medinets > Quality = Resource Multiplication > http://www.codebits.com > > __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-user-help@jakarta.apache.org