You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Yonik Seeley (JIRA)" <ji...@apache.org> on 2008/08/07 17:29:44 UTC

[jira] Updated: (LUCENE-1352) trailing escaped backslashes in quoted queries cause parse error

     [ https://issues.apache.org/jira/browse/LUCENE-1352?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Yonik Seeley updated LUCENE-1352:
---------------------------------

    Description: 
{noformat} 
The QueryParser fails to parse queries that contain escaped backslashes followed
 by a closing double-quote, then an opening double-quote (as part of another term).

For example, the query:

tagOrig:"testing\\" title:"titleTest"

will fail with the exception:

org.apache.lucene.queryParser.ParseException: Cannot parse 'tagOrig:"testing\\" title:"titleTest"': Lexical error at line 1, column 38.  Encountered: <EOF> after : ""
                at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:155)
                at org.apache.solr.search.LuceneQParser.parse(LuceneQParserPlugin.java:79)

After digging around, I found that 'QueryParserTokenManager:jjMoveNfa_3' is
generating - 'testing\\\" title:' as the token following the opening quote. It should
be generating 'testing\\'; it appears to see the first double-quote as being escaped
by the preceding slashes. 
{noformat} 

  was:
The QueryParser fails to parse queries that contain escaped backslashes followed by a closing double-quote, then an opening double-quote (as part of another term).

For example, the query:

tagOrig:"testing\\" title:"titleTest"

will fail with the exception:

org.apache.lucene.queryParser.ParseException: Cannot parse 'tagOrig:"testing\\" title:"titleTest"': Lexical error at line 1, column 38.  Encountered: <EOF> after : ""
                at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:155)
                at org.apache.solr.search.LuceneQParser.parse(LuceneQParserPlugin.java:79)

After digging around, I found that 'QueryParserTokenManager:jjMoveNfa_3' is generating - 'testing\\\" title:' as the token following the opening quote. It should be generating 'testing\\'; it appears to see the first double-quote as being escaped by the preceding slashes. 


> trailing escaped backslashes in quoted queries cause parse error
> ----------------------------------------------------------------
>
>                 Key: LUCENE-1352
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1352
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: QueryParser
>    Affects Versions: 2.3.2
>         Environment: Ubuntu 7.04, Sun JVM 1.5.0_1
>            Reporter: Michael Dodsworth
>
> {noformat} 
> The QueryParser fails to parse queries that contain escaped backslashes followed
>  by a closing double-quote, then an opening double-quote (as part of another term).
> For example, the query:
> tagOrig:"testing\\" title:"titleTest"
> will fail with the exception:
> org.apache.lucene.queryParser.ParseException: Cannot parse 'tagOrig:"testing\\" title:"titleTest"': Lexical error at line 1, column 38.  Encountered: <EOF> after : ""
>                 at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:155)
>                 at org.apache.solr.search.LuceneQParser.parse(LuceneQParserPlugin.java:79)
> After digging around, I found that 'QueryParserTokenManager:jjMoveNfa_3' is
> generating - 'testing\\\" title:' as the token following the opening quote. It should
> be generating 'testing\\'; it appears to see the first double-quote as being escaped
> by the preceding slashes. 
> {noformat} 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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