Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-63676

Lucene cannot parse terms ending with a backslash

Details

    Description

      Reproduction steps:

      1. In Control Panel -> Server Administration -> Log Levels, add com.liferay.portal.search.lucene.LuceneHelperImpl to WARN
      2. Add a search portlet to a page
      3. Search for anything with a backslash at the end, e.g. "test\"

      Result: The following warning occurs in the log:

      10:35:15,412 WARN  [ajp-apr-8010-exec-41][LuceneHelperImpl:269] org.apache.lucene.queryParser.ParseException: Cannot parse '\': Lexical error at line 1, column 2.  Encountered: <EOF> after : ""
      org.apache.lucene.queryParser.ParseException: Cannot parse '\': Lexical error at line 1, column 2.  Encountered: <EOF> after : ""
              at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:216)
              at com.liferay.portal.search.lucene.LuceneHelperImpl.addTerm(LuceneHelperImpl.java:251)
              at com.liferay.portal.search.lucene.LuceneHelperImpl.addTerm(LuceneHelperImpl.java:218)
              at com.liferay.portal.search.lucene.LuceneHelperUtil.addTerm(LuceneHelperUtil.java:268)
              at com.liferay.portal.search.lucene.LuceneHelperUtil.addTerm(LuceneHelperUtil.java:262)
              at com.liferay.portal.search.lucene.BooleanQueryImpl.addTerm(BooleanQueryImpl.java:270)
      

      Expected: No warnings should appear.

      Attachments

        Issue Links

          Activity

            People

              hong.zhao Hong Zhao (Inactive)
              norbert.kocsis Norbert Kocsis (Inactive)
              Marta Elicegui Marta Elicegui
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                7 years, 4 weeks, 3 days ago

                Packages

                  Version Package
                  6.2.X EE