lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Magoffin" <apache....@msqr.us>
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;
import org.apache.lucene.search.Query;

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: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message