lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENE-573) Escaped quotes inside a phrase cause a ParseException
Date Wed, 08 Nov 2006 01:56:58 GMT
    [ http://issues.apache.org/jira/browse/LUCENE-573?page=comments#action_12448007 ] 
            
Yonik Seeley commented on LUCENE-573:
-------------------------------------

The number of people searching for '\' must be minuscule (to non-existent), so I'm personally
OK with doing what makes the most sense.

In general, I think it's more user friendly and less surprising to allow a backslash escape
of something that doesn't need it (while removing the backslash).

So 
\\ => \
\" => "
\+ => +      // not a necessary escape if in a quoted string, but consistent

Then there are the "control" chars, \r\n\t, etc.

At some point we might want to allow unicode escapes, and keeping backslash as a general escape
char will facilitate this.

> Escaped quotes inside a phrase cause a ParseException
> -----------------------------------------------------
>
>                 Key: LUCENE-573
>                 URL: http://issues.apache.org/jira/browse/LUCENE-573
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: QueryParser
>    Affects Versions: 1.9
>         Environment: Debian Sarge, Sun JDK 1.4.2
>            Reporter: Tomislav Gountchev
>         Assigned To: Michael Busch
>            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:
> http://www.nabble.com/ParseException-with-escaped-quotes-in-a-phrase-t1647115.html

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message