lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley (JIRA)" <>
Subject [jira] Commented: (LUCENE-573) Escaped quotes inside a phrase cause a ParseException
Date Sun, 20 Aug 2006 21:04:15 GMT
    [ ] 
Yonik Seeley commented on LUCENE-573:

> it seems like query parser should be unescaping it automatically for you

That's my take.  \" should return the user "
To enable representation of a real backslash followed by a quote, or a backslash at the end
of a line, backslashes also need escaping (with another backslash... same as C, Java, etc).

Now the question is if \+ should be returned as + or \+
If we were starting from scratch, I'd say remove the backslash (return +) since that's most
consistent with escaping mechanisms in other languages, and it does the right thing if a user
escapes something they don't need to.  So does anyone currently search for backslash in a
phrase query???

> Escaped quotes inside a phrase cause a ParseException
> -----------------------------------------------------
>                 Key: LUCENE-573
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: QueryParser
>    Affects Versions: 1.9
>         Environment: Debian Sarge, Sun JDK 1.4.2
>            Reporter: Tomislav Gountchev
>            Priority: Minor
>         Attachments: escaped_quotes_inside_phrases.patch
> QueryParser cannot handle escaped quotes when inside a phrase. Escaped quotes not in
a phrase are not a problem. This can be added to TestQueryParser.testEscaped() to demonstrate
the issue - the second assert throws an exception:
> assertQueryEquals("a \\\"b c\\\" d", a, "a \"b c\" d");
> assertQueryEquals("\"a \\\"b c\\\" d\"", a, "\"a \"b c\" d\"");
> See also this thread:

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


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

View raw message