我有这些聚合器来重复删除文档:
$searchParams['body'] = [
'aggs' => [
'dedup' => [
'terms' => [
'field' => 'source',
'size' => 50,
'order' => [
'max_hits' => "desc"
]
],
'aggs' => [
'dedup_hits' => [
'top_hits' => [
'size' => 1
]
],
'max_hits' => [
'max' => [
"script" => "doc.score"
]
]
]
]
]
];
此查询按文档分数排序。但是,我想按_timestamp字段排序。可能吗?我用Date Histogram聚合器测试了。但没有成功。