For exporting data shoud we use scroll or pit with search after?

I guess it will depend on which version you are using, but for Elasticsearch 8.4 the recommendation is:

We no longer recommend using the scroll API 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).

2 Likes