- Type Parameters:
H- The type of hits.
- All Superinterfaces:
- All Known Subinterfaces:
public interface SearchScroll<H> extends AutoCloseableAn ongoing query execution delivering hits continuously from a single snapshot of the index.
This is different from classic pagination, where a loop executes the same query multiple times with an incrementing offset. Classic pagination will execute the query against a different snapshot of the index for each call to
fetch(...), potentially leading to some hits appearing in two subsequent pages if the index was modified between two executions. Scrolls do not suffer from this limitation and guarantee that each hit is returned only once.
As the scroll maintains a reference to internal resources that ultimately must be freed, the client must call
close()when it no longer needs the scroll. Additionally, some implementations have an internal timeout beyond which the scroll will automatically close and will no longer be usable.
All Methods Instance Methods Abstract Methods Modifier and Type Method Description
next()Returns the next chunk, with at most
- Specified by:
SearchScrollResult<H> next()Returns the next chunk, with at most
May return a result with less than
chunkSizeelements if only that many hits are left.
- The next
- See Also: