[es 5.6.8] How to tanslate this postgre sql to es ver -- order by count(id) over (partition by org_name, visit_datetime) desc

Hi there, I'm stuck. How to tanslate this postgre sql to Elasticsearch ver?
The Elasticsearch is 5.6.8, but the solution with higher version is also welcome!

select user_name from tablea  
order by count(meid) over (partition by org_name, visit_datetime) desc
limit 10
offset 10

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