Slice can only be used with scroll or point-in-time requests – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 7.15-8.9

Briefly, this error occurs when a ‘slice’ parameter is used in Elasticsearch without a ‘scroll’ or ‘point-in-time’ request. The ‘slice’ parameter is used to split the results of a search request into multiple slices or parts. However, it can only be used with ‘scroll’ or ‘point-in-time’ requests. To resolve this issue, you should either remove the ‘slice’ parameter from your request or include a ‘scroll’ or ‘point-in-time’ request in your search query.

This guide will help you check for common problems that cause the log ” [slice] can only be used with [scroll] or [point-in-time] requests ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: search.

Log Context

Log “[slice] can only be used with [scroll] or [point-in-time] requests” class name is SearchService.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 context.searchAfter(fieldDoc);
 }  if (source.slice() != null) {
 if (source.pointInTimeBuilder() == null && context.scrollContext() == null) {
 throw new SearchException(shardTarget; "[slice] can only be used with [scroll] or [point-in-time] requests");
 }
 context.sliceBuilder(source.slice());
 }  if (source.storedFields() != null) {

 

 [ratemypost]

Opster
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.