Class ScrollRequest
- All Implemented Interfaces:
JsonpSerializable
IMPORTANT: The scroll API is no longer recommend for deep pagination. If you
need to preserve the index state while paging through more than 10,000 hits,
use the search_after
parameter with a point in time (PIT).
The scroll API gets large sets of results from a single scrolling search
request. To get the necessary scroll ID, submit a search API request that
includes an argument for the scroll
query parameter. The
scroll
parameter indicates how long Elasticsearch should retain
the search context for the request. The search response returns a scroll ID
in the _scroll_id
response body parameter. You can then use the
scroll ID with the scroll API to retrieve the next batch of results for the
request. If the Elasticsearch security features are enabled, the access to
the results of a specific scroll ID is restricted to the user or API key that
submitted the search.
You can also use the scroll API to specify a new scroll parameter that extends or shortens the retention period for the search context.
IMPORTANT: Results from a scrolling search reflect the state of the index at the time of the initial search request. Subsequent indexing or document changes only affect later search and scroll requests.
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class co.elastic.clients.elasticsearch._types.RequestBase
RequestBase.AbstractBuilder<BuilderT extends RequestBase.AbstractBuilder<BuilderT>>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final JsonpDeserializer<ScrollRequest>
Json deserializer forScrollRequest
static final SimpleEndpoint<ScrollRequest,
?> Endpoint "scroll
". -
Method Summary
Modifier and TypeMethodDescriptionstatic <TDocument>
Endpoint<ScrollRequest,ScrollResponse<TDocument>, ErrorResponse> createScrollEndpoint
(JsonpDeserializer<TDocument> tDocumentDeserializer) Create an "scroll
" endpoint.static ScrollRequest
final Time
scroll()
The period to retain the search context for scrolling.final String
scrollId()
Required - The scroll ID of the search.void
serialize
(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) Serialize this object to JSON.protected void
serializeInternal
(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) protected static void
Methods inherited from class co.elastic.clients.elasticsearch._types.RequestBase
toString
-
Field Details
-
_DESERIALIZER
Json deserializer forScrollRequest
-
_ENDPOINT
Endpoint "scroll
".
-
-
Method Details
-
of
-
scroll
The period to retain the search context for scrolling.API name:
scroll
-
scrollId
Required - The scroll ID of the search.API name:
scroll_id
-
serialize
Serialize this object to JSON.- Specified by:
serialize
in interfaceJsonpSerializable
-
serializeInternal
-
setupScrollRequestDeserializer
-
createScrollEndpoint
public static <TDocument> Endpoint<ScrollRequest,ScrollResponse<TDocument>, createScrollEndpointErrorResponse> (JsonpDeserializer<TDocument> tDocumentDeserializer) Create an "scroll
" endpoint.
-