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

Michael Dürig updated OAK-2774:
-------------------------------
    Component/s:     (was: oak-lucene)
                 lucene

> Invalid characters not escaped while fulltext query parsing
> -----------------------------------------------------------
>
>                 Key: OAK-2774
>                 URL: https://issues.apache.org/jira/browse/OAK-2774
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: lucene
>    Affects Versions: 1.2
>            Reporter: Rishabh Maurya
>
> Invalid characters such as forward slash {{/}} should be escaped, as fulltext 
> search on them results in below error - 
> {code}
> java.lang.RuntimeException: INVALID_SYNTAX_CANNOT_PARSE: Syntax Error, cannot 
> parse /bar: Lexical error at line 1, column 5.  Encountered: <EOF> after : 
> "/bar" 
>       at 
> org.apache.jackrabbit.oak.plugins.index.lucene.LucenePropertyIndex.tokenToQuery(LucenePropertyIndex.java:1042)
>       at 
> org.apache.jackrabbit.oak.plugins.index.lucene.LucenePropertyIndex$2.visitTerm(LucenePropertyIndex.java:983)
>       at 
> org.apache.jackrabbit.oak.plugins.index.lucene.LucenePropertyIndex$2.visit(LucenePropertyIndex.java:978)
>       at 
> org.apache.jackrabbit.oak.query.fulltext.FullTextTerm.accept(FullTextTerm.java:215)
>       at 
> org.apache.jackrabbit.oak.plugins.index.lucene.LucenePropertyIndex.getFullTextQuery(LucenePropertyIndex.java:933)
>       at 
> org.apache.jackrabbit.oak.plugins.index.lucene.LucenePropertyIndex.getLuceneRequest(LucenePropertyIndex.java:519)
>       at 
> org.apache.jackrabbit.oak.plugins.index.lucene.LucenePropertyIndex.access$200(LucenePropertyIndex.java:160)
>       at 
> org.apache.jackrabbit.oak.plugins.index.lucene.LucenePropertyIndex$1.loadDocs(LucenePropertyIndex.java:321)
>       at 
> org.apache.jackrabbit.oak.plugins.index.lucene.LucenePropertyIndex$1.computeNext(LucenePropertyIndex.java:274)
>       at 
> org.apache.jackrabbit.oak.plugins.index.lucene.LucenePropertyIndex$1.computeNext(LucenePropertyIndex.java:265)
>       at 
> com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
>       at 
> com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)
>       at 
> org.apache.jackrabbit.oak.plugins.index.lucene.LucenePropertyIndex$LucenePathCursor$1.hasNext(LucenePropertyIndex.java:1138)
> ...
> {code}
> http://lucene.apache.org/core/4_0_0/queryparser/org/apache/lucene/queryparser/classic/QueryParserBase.html#escape(java.lang.String)
> should be used to escape such invalid characters.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to