elasticsearch 按子元素的个数排序


比如 questions

{
"title":"xxx",
"descriptions": "xxx",
"answers": [
{ "answer":"yyy"},
{ "answer":"zzz"}
]
}

就是 查询所有questions list 安answer的数量排序。怎么排序? 哪位知道?

elasticsearch

Treed 11 years, 9 months ago

为什么不添加了下字段来统计answer的数量,然后再根据这个统计的字段来进行排序呢?

agwcc answered 11 years, 9 months ago

Your Answer