We want to utilize the search_after pagination strategy rather than from-size pagination strategy as we understood that search_after has better performance for high pagination numbers.
At the same time, we do collapse our query results base on specific field. We are aware of the limitation that search_after can't be applied when collapse is utilized.
Question A: Based on https://github.com/elastic/elasticsearch/issues/53115, composite aggregation can be used as an alternative to from-size pagination - do I understand correctly that composite aggregation is used to retrieve page of "record ids", and second query is used to fetch records by ids returned from aggregation?
Question B: Are there other, performance wise better pagination approaches than from-size, that can be used together with field collapsing?