Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@www.apache.org Received: (qmail 96514 invoked from network); 28 Oct 2004 18:02:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 28 Oct 2004 18:02:24 -0000 Received: (qmail 49439 invoked by uid 500); 28 Oct 2004 18:02:16 -0000 Delivered-To: apmail-jakarta-lucene-user-archive@jakarta.apache.org Received: (qmail 49404 invoked by uid 500); 28 Oct 2004 18:02:16 -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 49378 invoked by uid 99); 28 Oct 2004 18:02:16 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [63.100.163.104] (HELO hermes.corp.cyveillance.com) (63.100.163.104) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 28 Oct 2004 11:02:13 -0700 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: Searching for a phrase that contains quote character X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Date: Thu, 28 Oct 2004 14:02:11 -0400 Message-ID: <63434C14F9A6F74CB36B85033E4C30CA5BFBC3@hermes.corp.cyveillance.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Searching for a phrase that contains quote character Thread-Index: AcS9F+rSyjpvLDP1SO6jvpv2YWZZVgAAEvQQ From: "Will Allen" To: "Lucene Users List" X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N I am using a NullAnalyzer for this field. =20 -----Original Message----- From: Erik Hatcher [mailto:erik@ehatchersolutions.com] Sent: Thursday, October 28, 2004 2:00 PM To: Lucene Users List Subject: Re: Searching for a phrase that contains quote character On Oct 28, 2004, at 1:03 PM, Justin Swanhart wrote: > Have you tried making a term query by hand and testing to see if it =20 > works? > > Term t =3D new Term("field", "this is a \"test\""); > PhraseQuery pq =3D new PhraseQuery(t); That's not accurate API, but add you used pq.add(t), it still would =20 presume that text is all a single term. Chances are, though, that even getting the query to have the quotes is =20 not going to work as you've probably lost the quotes during indexing. =20 Check out the AnalysisParalysis page on the wiki and "analyze" your =20 Analyzer and make sure you are indexing the text with the quotes (no =20 built-in analyzer besides WhitespaceAnalyzer would do that for you). Erik > ... > > > > On Thu, 28 Oct 2004 12:02:48 -0400, Will Allen =20 > wrote: >> >> I am having this same problem, but cannot find any help! >> >> I have a keyword field that sometimes includes double quotes, but I =20 >> am unable to search for that field because the escape for a quote =20 >> doesnt work! >> >> I have tried a number of things: >> >> myfield:"lucene is \"cool\"" >> >> AND >> >> myfield:"lucene is \\"cool\\"" >> >> http://issues.apache.org/eyebrowse/ReadMsg?listName=3Dlucene-=20 >> user@jakarta.apache.org&msgNo=3D7351 >> >> From: danrapp@comcast.net >> Subject: Searching for a phrase that contains quote character >> Date: Wed, 24 Mar 2004 21:25:16 +0000 >> >> I'd like to search for a phrase that contains the quote character. =20 >> I've tried >> escaping the quote character, but am receiving a ParseException from = >> the >> QueryParser: >> >> For example to search for the phrase: >> >> this is a "test" >> >> I'm trying the following >> >> QueryParser.parse("field:\"This is a \\\"test\\\"\"", "field", =20 >> new StandardAnalyzer()); >> >> This results in: >> >> org.apache.lucene.queryParser.ParseException: Lexical error at line =20 >> 1, column 31. Encountered: after : "" >> at =20 >> org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:111) >> at =20 >> org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:87) >> ... >> >> What is the proper way to accomplish this? >> >> --Dan >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org >> For additional commands, e-mail: lucene-user-help@jakarta.apache.org >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: lucene-user-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-user-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-user-help@jakarta.apache.org