elasticsearch从一个查询中获得按字段排名的排名

时间:2018-09-25 09:41:31

标签: elasticsearch

例如,这是我在elasticsearch中的数据:

{"name":"Tom", "score":100, "subject":"math"}
{"name":"Amy", "score":90, "subject":"math"}
{"name":"Jeffry", "score":95, "subject":"math"}

{"name":"Tom", "score":80, "subject":"verbal"}
{"name":"Amy", "score":98, "subject":"verbal"}
{"name":"Jeffry", "score":70, "subject":"verbal"}

{"name":"Tom", "score":90, "subject":"science"}
{"name":"Amy", "score":85, "subject":"science"}
{"name":"Jeffry", "score":70, "subject":"science"}

我如何获得汤姆在所有科目的分数中的排名?像{“数学”:1,“语言”:2,“科学”:1}

0 个答案:

没有答案