在elasticsearch的实现中,基于几个字段,我只有几个简单的聚合,如下所示:
"aggs" : {
"author" : {
"terms" : { "field" : "author"
, "size": 20,
"order" : { "_term" : "asc" }
}
},
"title" : {
"terms" : { "field" : "title"
, "size": 20
}
},
"contentType" : {
"terms" : { "field" : "docType"
, "size": 20
}
}
}
聚合工作正常,我得到了相应的结果。但是返回的标题键字段(或任何其他字段-多字)具有单个字的汇总和结果。我需要返回结果中的完整标题,而不是一个单词-
没什么意义。我该怎么办。
当前结果(仅是摘录)-
"title": {
"buckets": [
{
"key": "test",
"doc_count": 1716
},