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

Search portlet crashes with an Advanced Search Syntax query and Solr

    Details

      Description

      A search containing an uppercase boolean operator, like foo OR bar, will crash the search portlet when Solr is configured as the search engine and Advanced Search Syntax mode is enabled.

      Steps to Reproduce:

      1. Set up Solr as the search engine
      2. Go to the Search Portlet Configuration > Other Settings > check Use Advanced Search Syntax
      3. Search for foo OR bar

      Expected Result:
      Search would be executed without error

      Actual Result:
      Search portlet displays "Portlet is temporarily unavailable." error message

      Stacktrace shown in logs:

      ERROR [http-nio-8080-exec-4][render_portlet_jsp:131] null
      org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at http://localhost:8983/solr/liferay: org.apache.solr.search.SyntaxError: Cannot parse 'gram3:ava OR gram3:va  OR gram3:a O OR gram3: OR OR gram3:OR  OR gram3:R p OR gram3: po OR gram3:por OR gram3:ort OR gram3:rta OR gram4:ava  OR gram4:va O OR gram4:a OR OR gram4: OR  OR gram4:OR p OR gram4:R po OR gram4: por OR gram4:port OR gram4:orta OR end4:rtal OR end3:tal OR start3:jav OR start4:java OR spellCheckWord:java OR portal': Encountered " <OR> "OR "" at line 1, column 46._Was expecting one of:_    <BAREOPER> ..._    "(" ..._    "*" ..._    <QUOTED> ..._    <TERM> ..._    <PREFIXTERM> ..._    <WILDTERM> ..._    <REGEXPTERM> ..._    "[" ..._    "{" ..._    <LPARAMS> ..._    <NUMBER> ..._     [Sanitized]
      	at org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:560)
      	at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:235)
      	at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:227)
      	at org.apache.solr.client.solrj.impl.LBHttpSolrClient.request(LBHttpSolrClient.java:526)
      	at com.liferay.portal.search.solr.internal.connection.ReadWriteSolrClient.request(ReadWriteSolrClient.java:56)
      	at org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:135)
      	at org.apache.solr.client.solrj.SolrClient.query(SolrClient.java:975)
      	at org.apache.solr.client.solrj.SolrClient.query(SolrClient.java:991)
      	at com.liferay.portal.search.solr.internal.SolrQuerySuggester.suggestKeywords(SolrQuerySuggester.java:304)
      	at com.liferay.portal.search.solr.internal.SolrQuerySuggester.suggestKeywords(SolrQuerySuggester.java:255)
      	at com.liferay.portal.search.solr.internal.SolrQuerySuggester.spellCheckKeywords(SolrQuerySuggester.java:88)
      	at com.liferay.portal.kernel.search.suggest.BaseQuerySuggester.spellCheckKeywords(BaseQuerySuggester.java:34)
      	at com.liferay.portal.kernel.search.BaseIndexSearcher.spellCheckKeywords(BaseIndexSearcher.java:73)
      

       Reproduced on master - 9410f63

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              brian.chan Brian Chan
              Reporter:
              bryan.engler Bryan Engler
              Participants of an Issue:
              Recent user:
              Brian Wulbern
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                4 years, 24 weeks ago

                  Packages

                  Version Package
                  7.0.X EE
                  7.1.X
                  Master