searchAfter

suspend fun SearchClient.searchAfter(target: String, keepAlive: Duration, query: SearchDSL, optInToCustomSort: Boolean = false, retries: Int = 3, retryDelay: Duration = 2.seconds): Pair<SearchResponse, Flow<SearchResponse.Hit>>

Perform a deep paging search using point in time and search after.

Creates a point in time and then uses it to deep page through search results using search after. Note, this modifies the query via the search dsl.

Note, if you specify a sort, be sure to include _shard_doc as a tie breaker.

Return

a pair of the first response and a flow of hits that when consumed pages through the results using the point in time id and the sort.


suspend fun SearchClient.searchAfter(target: String, keepAlive: Duration = 1.minutes, optInToCustomSort: Boolean = false, block: SearchDSL.() -> Unit? = null): Pair<SearchResponse, Flow<SearchResponse.Hit>>