lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomi <>
Subject ParseException with escaped quotes in a phrase
Date Fri, 19 May 2006 00:29:28 GMT

Looks like QueryParser doesn't handle escaped quotes when inside a phrase:

public static void main(String[] args) throws Exception {
	String s = "Re:abcde jjj\"efgh asdf\" dsfdsf";
	QueryParser parser = new QueryParser("subject", new StandardAnalyzer());
	s = QueryParser.escape(s);
	s = "\""+s+"\"";

This throws a ParseException on the last line. This is with lucene 1.9.1 and
also from cvs. I was trying to implement an advanced search form where the
user can enter a text in a "search for this exact phrase" field, without
having to know the lucene syntax. My original idea was to use
QueryParser.escape() so that any punctuation is not interpreted, but
apparently quotes just have to be removed first.

Tomislav Gountchev

View this message in context:
Sent from the Lucene - Java Developer forum at

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

View raw message