lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Will Allen" <>
Subject Searching for a phrase that contains quote character
Date Thu, 28 Oct 2004 16:02:48 GMT

I am having this same problem, but cannot find any help!

I have a keyword field that sometimes includes double quotes, but I am unable to search for
that field because the escape for a quote doesnt work!

I have tried a number of things:

myfield:"lucene is \"cool\""


myfield:"lucene is \\"cool\\""

From: <>
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. I've tried 
escaping the quote character, but am receiving a ParseException from the 

For example to search for the phrase:

     this is a "test"

I'm trying the following

     QueryParser.parse("field:\"This is a \\\"test\\\"\"", "field", new StandardAnalyzer());

This results in:

org.apache.lucene.queryParser.ParseException: Lexical error at line 1, column 31.  Encountered:
<EOF> after : ""
	at org.apache.lucene.queryParser.QueryParser.parse(
	at org.apache.lucene.queryParser.QueryParser.parse(

What is the proper way to accomplish this?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message