我需要将此SQL查询转换为Elastic搜索
select f.name, f.major as mxmajor, f.minor as miminor
from (
select name, description, max(major) as maxmajor, max(minor) as maxminor
from data group by name,major
) as x inner join data as f on f.name = x.name and f.major=x.maxmajor and f.minor=x.maxminor