elasticsearch query of group by -


i want result top n data every group after group & sort. need list of that.

like mysql query:

select a.person, a.group, a.age person (select count(*) person b  b.group = a.group , b.age >= a.age) <= 2  order a.group asc, a.age desc 

can guys me? thx lot.

try nested aggregation , in aggregation can sort also. check out :- sorting after aggregation in elasticsearch


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -