Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-16917

QueryPhaseExecutionException: Result window is too large Thrown for Search API

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: New
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.10.0, 3.15.2
    • Fix Version/s: None
    • Component/s: Scalability, Search
    • Labels:
    • Story Points:
      3
    • Notability:
      2

      Description

      When paginating through a large set of search results using the search API (/service/rest/beta/search/ or /service/rest/beta/search/assets) a HTTP 500 error can be returned for the following reason:

       QueryPhaseExecutionException[Result window is too large, from + size must be less than or equal to: [10000] but was [10050]. See the scroll api for a more efficient way to request large data sets. This limit can be set by changing the [index.max_result_window] index level parameter.]; }
      org.elasticsearch.action.search.SearchPhaseExecutionException: all shards failed
      at org.elasticsearch.action.search.AbstractSearchAsyncAction.onFirstPhaseResult(AbstractSearchAsyncAction.java:206)
      at org.elasticsearch.action.search.AbstractSearchAsyncAction$1.onFailure(AbstractSearchAsyncAction.java:152)
      at org.elasticsearch.action.ActionListenerResponseHandler.handleException(ActionListenerResponseHandler.java:46)
      at org.elasticsearch.transport.TransportService$DirectResponseChannel.processException(TransportService.java:874)
      at org.elasticsearch.transport.TransportService$DirectResponseChannel.sendResponse(TransportService.java:852)
      at org.elasticsearch.transport.TransportService$4.onFailure(TransportService.java:389)
      at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:39)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
      Caused by: org.elasticsearch.search.query.QueryPhaseExecutionException: Result window is too large, from + size must be less than or equal to: [10000] but was [10050]. See the scroll api for a more efficient way to request large data sets. This limit can be set by changing the [index.max_result_window] index level parameter.
      at org.elasticsearch.search.internal.DefaultSearchContext.preProcess(DefaultSearchContext.java:212)
      at org.elasticsearch.search.query.QueryPhase.preProcess(QueryPhase.java:103)
      at org.elasticsearch.search.SearchService.createContext(SearchService.java:689)
      at org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:633)
      at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:377)
      at org.elasticsearch.search.action.SearchServiceTransportAction$SearchQueryTransportHandler.messageReceived(SearchServiceTransportAction.java:368)
      at org.elasticsearch.search.action.SearchServiceTransportAction$SearchQueryTransportHandler.messageReceived(SearchServiceTransportAction.java:365)
      at org.elasticsearch.transport.TransportRequestHandler.messageReceived(TransportRequestHandler.java:33)
      at org.elasticsearch.transport.RequestHandlerRegistry.processMessageReceived(RequestHandlerRegistry.java:77)
      at org.elasticsearch.transport.TransportService$4.doRun(TransportService.java:378)
      at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)

      This is happening due to the default result window value of 10,000 for Elasticsearch being exceeded.

       

      Expected:
      Either limit search results when using the API and make it explicit to users that results have been/will be limited to n results (similar to -------NEXUS-10284-------)  or enable all results to be returned for a given search when using the API.

       

      Workaround:
      Add the 'index.max_result_window' property in <nexus_install>/etc/fabric/elasticsearch.yml file and restart Nexus:

      index.max_result_window: <some_integer_value_greater_than_10000>
      

      Note: Increasing this value can result in an increase of heap usage.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mmartz Michael Martz
              Reporter:
              hardeepn Hardeep Nagra
              Last Updated By:
              Joe Tom
              Votes:
              7 Vote for this issue
              Watchers:
              16 Start watching this issue

                Dates

                Created:
                Updated:
                Date of First Response:

                  tigCommentSecurity.panel-title