lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Magoffin" <>
Subject QueryParser exception on escaped double quote character
Date Wed, 05 Oct 2005 03:10:19 GMT
I'm having a problem getting the QueryParser to correctly parse a string
like the following:

addr:"Foo \"Bar\" Street"

Should this work, or is there some other way to escape double quotes
within a quoted query term? Here is a unit test that shows the problem:

import junit.framework.TestCase;

import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.queryParser.QueryParser;

public class TestQueryParser extends TestCase {

	public void testLuceneEscapedQuotesBug() throws Exception {
		// this fails
		Query q = new QueryParser("foo",new StandardAnalyzer()).parse(
			"addr:\"My \\\"A\\\" Street\"");


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

View raw message