Sorting on the sub-aggregation fields and applying Pagination on the same

I need to sort the aggregation on the basis of sub-aggregation values and also apply pagination on the same .
I found in documentation that we can do pagination with composite aggregation but can not sort on the basis of sub-aggregation or doc_count. But if we use normal aggregation we can sort the aggregation on the basis of sub-aggregation but can not apply pagination .
Can anyone please suggest any way around where I can use both pagination as well as sorting .

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.