Return-Path: Delivered-To: apmail-jakarta-lucene-dev-archive@www.apache.org Received: (qmail 59440 invoked from network); 3 Mar 2004 12:33:30 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 3 Mar 2004 12:33:30 -0000 Received: (qmail 33307 invoked by uid 500); 3 Mar 2004 12:33:25 -0000 Delivered-To: apmail-jakarta-lucene-dev-archive@jakarta.apache.org Received: (qmail 33285 invoked by uid 500); 3 Mar 2004 12:33:24 -0000 Mailing-List: contact lucene-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Developers List" Reply-To: "Lucene Developers List" Delivered-To: mailing list lucene-dev@jakarta.apache.org Received: (qmail 33172 invoked from network); 3 Mar 2004 12:33:23 -0000 Received: from unknown (HELO web12707.mail.yahoo.com) (216.136.173.244) by daedalus.apache.org with SMTP; 3 Mar 2004 12:33:23 -0000 Message-ID: <20040303123323.95854.qmail@web12707.mail.yahoo.com> Received: from [194.152.224.45] by web12707.mail.yahoo.com via HTTP; Wed, 03 Mar 2004 04:33:23 PST Date: Wed, 3 Mar 2004 04:33:23 -0800 (PST) From: Otis Gospodnetic Subject: RE: Question regarding escaped sequence To: Lucene Developers List , halleux.jf@skynet.be In-Reply-To: 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: minotaur-2.apache.org 1.6.2 0/1000/N I closed the latter two, but the first one is a JMeter bug. Thanks for your work, I think this fix will make several people happy! Otis --- Jean-Francois Halleux wrote: > Otis, you can probably close bugs 16370, 11636, and 14665 as well. > > Have a look at those too. > > KR, > > Jeff > > -----Original Message----- > From: Otis Gospodnetic [mailto:otis_gospodnetic@yahoo.com] > Sent: mercredi 3 mars 2004 12:19 > To: Lucene Developers List > Subject: Re: Question regarding escaped sequence > > > This indeed fixes the bug that the code further below demonstrates, > so > I'm comitting it. > > http://issues.apache.org/bugzilla/show_bug.cgi?id=24665 > > Otis > > --- Otis Gospodnetic wrote: > > I have a feeling that query escaping really is broken in Lucene. > > Try running the class below like this: > > > > prompt> java Escaper '+string' '\+string' > > > > I get: > > > > $ java Escaper '+string' '\+string' > > 0: +string > > 1: \+string > > QUERY: \+string > > HITS: 0 > > > > That should give me 1 hit, shouldn't it? > > > > import org.apache.lucene.queryParser.QueryParser; > > import org.apache.lucene.analysis.*; > > import org.apache.lucene.search.*; > > import org.apache.lucene.index.*; > > import org.apache.lucene.store.*; > > import org.apache.lucene.document.*; > > > > public class Escaper > > { > > public static void main(String[] args) throws Exception > > { > > System.out.println("0: " + args[0]); > > System.out.println("1: " + args[1]); > > > > Directory dir = new RAMDirectory(); > > IndexWriter writer = new IndexWriter(dir, new > > WhitespaceAnalyzer(), true); > > Document doc = new Document(); > > doc.add(Field.Text("text", args[0])); > > writer.addDocument(doc); > > writer.optimize(); > > writer.close(); > > > > QueryParser qp = new QueryParser("text", new > > WhitespaceAnalyzer()); > > Query q = qp.parse(args[1]); > > System.out.println("QUERY: " + q.toString("text")); > > > > IndexSearcher searcher = new IndexSearcher(dir); > > Hits hits = searcher.search(q); > > System.out.println("HITS: " + hits.length()); > > searcher.close(); > > } > > } > > > > Thanks, > > Otis > > > > > > --- Jean-Francois Halleux wrote: > > > Hello, > > > > > > in TestQueryParser, method testEscaped(), I see the following: > > > > > > ... > > > assertQueryEquals("\\+blah", a, "\\+blah"); > > > assertQueryEquals("\\(blah", a, "\\(blah"); > > > > > > assertQueryEquals("\\-blah", a, "\\-blah"); > > > assertQueryEquals("\\!blah", a, "\\!blah"); > > > assertQueryEquals("\\{blah", a, "\\{blah"); > > > assertQueryEquals("\\}blah", a, "\\}blah"); > > > ... > > > > > > is this really the expected behavior? Shouldn't \\-blah be > > > interpreted > > > as -blah and \\!blah as !blah ? > > > > > > Thanks, > > > > > > Jean-Francois Halleux > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org > > > For additional commands, e-mail: > lucene-dev-help@jakarta.apache.org > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org > > For additional commands, e-mail: lucene-dev-help@jakarta.apache.org > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org > For additional commands, e-mail: lucene-dev-help@jakarta.apache.org > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org > For additional commands, e-mail: lucene-dev-help@jakarta.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-dev-help@jakarta.apache.org