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

Exception thrown when Maximum Query Terms is set to 0, Minimum Term Frequency is set to 1, and Field is blank

    Details

      Description

      An easy workaround is to define the field in Fields. For example, after setting Fields to "title_en_US" the issue is no longer reproducible.

      Steps to reproduce:

      1. Create two web content articles with the following titles:
        1. Similar Results Web Content 1
        2. Similar Results Web Content 2
      2. Add Similar Results and Asset Publisher to the page
      3. Make the following changes in Similar Results configuration:
        1. Maximum Query Terms: 0
        2. Minimum Term Frequency: 1
      4. Click on "Similar Results Web Content 1" in Asset Publisher

      Expected result:
      Expected no results with no exceptions thrown.

      Actual result:

      2020-01-31 01:02:56.315 ERROR [http-nio-8080-exec-7][ElasticsearchIndexSearcher:169] java.lang.RuntimeException: org.elasticsearch.action.search.SearchPhaseExecutionException: Failed to execute phase [query], all shards failed; shardFailures {[ruAnFIXLSO-eCgYVcr1Dyg][liferay-20095][0]: RemoteTransportException[[ruAnFIX][127.0.0.1:9300][indices:data/read/search[phase/query]]]; nested: NullPointerException; }
      java.lang.RuntimeException: org.elasticsearch.action.search.SearchPhaseExecutionException: Failed to execute phase [query], all shards failed; shardFailures {[ruAnFIXLSO-eCgYVcr1Dyg][liferay-20095][0]: RemoteTransportException[[ruAnFIX][127.0.0.1:9300][indices:data/read/search[phase/query]]]; nested: NullPointerException; }
      	at org.elasticsearch.action.search.AbstractSearchAsyncAction.onPhaseFailure(AbstractSearchAsyncAction.java:293)
      	at org.elasticsearch.action.search.AbstractSearchAsyncAction.executeNextPhase(AbstractSearchAsyncAction.java:133)
      	at org.elasticsearch.action.search.AbstractSearchAsyncAction.onPhaseDone(AbstractSearchAsyncAction.java:254)
      	at org.elasticsearch.action.search.InitialSearchPhase.onShardFailure(InitialSearchPhase.java:101)
      	at org.elasticsearch.action.search.InitialSearchPhase.access$100(InitialSearchPhase.java:48)
      	at org.elasticsearch.action.search.InitialSearchPhase$2.lambda$onFailure$1(InitialSearchPhase.java:222)
      	at org.elasticsearch.action.search.InitialSearchPhase.maybeFork(InitialSearchPhase.java:176)
      	at org.elasticsearch.action.search.InitialSearchPhase.access$000(InitialSearchPhase.java:48)
      	at org.elasticsearch.action.search.InitialSearchPhase$2.onFailure(InitialSearchPhase.java:222)
      	at org.elasticsearch.action.search.SearchExecutionStatsCollector.onFailure(SearchExecutionStatsCollector.java:73)
      	at org.elasticsearch.action.ActionListenerResponseHandler.handleException(ActionListenerResponseHandler.java:51)
      	at org.elasticsearch.action.search.SearchTransportService$ConnectionCountingHandler.handleException(SearchTransportService.java:464)
      	at org.elasticsearch.transport.TransportService$ContextRestoreResponseHandler.handleException(TransportService.java:1130)
      	at org.elasticsearch.transport.TransportService$DirectResponseChannel.processException(TransportService.java:1247)
      	at org.elasticsearch.transport.TransportService$DirectResponseChannel.sendResponse(TransportService.java:1221)
      	at org.elasticsearch.transport.TaskTransportChannel.sendResponse(TaskTransportChannel.java:66)
      	at org.elasticsearch.action.support.HandledTransportAction$ChannelActionListener.onFailure(HandledTransportAction.java:112)
      	at org.elasticsearch.search.SearchService$2.onFailure(SearchService.java:347)
      	at org.elasticsearch.search.SearchService$2.onResponse(SearchService.java:341)
      	at org.elasticsearch.search.SearchService$2.onResponse(SearchService.java:335)
      	at org.elasticsearch.search.SearchService$4.doRun(SearchService.java:1082)
      	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:723)
      	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)
      	at org.elasticsearch.common.util.concurrent.TimedRunnable.doRun(TimedRunnable.java:41)
      	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      

      Reproduced on:
      Tomcat 9.0.17 + MySQL 5.7
      Portal master GIT ID: 2c5c7969b3ee35b944879281b6a82fdb2c63bafa
      Portal 7.2.x GID ID: 178dbb73143636870f93db4fbff1029fce4f05f7

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                7 weeks, 1 day ago

                Packages

                Version Package
                7.2.X
                7.3.1 CE GA2
                7.3.2 CE GA3
                Master