I have an index with some 10m records.
When I try to find distincts in one field (around 2m) my Java runs out of
Can I implement a scan and scroll on this aggregation to retrieve the same
data in smaller parts.
Unfortunately not at the moment. However, you could look into spreading the
data around with more shards/nodes (thus lesser memory requirements per
node), or add more RAM, or possibly use disk-based fielddata: