目前查询下面删除单个字段上的重复项 - “名称”,但我们需要所有字段的top_hits结果:“name”,“venueName”,“venueTown”。这可以在一个查询中实现而不发送3个请求并将“field”设置为“venueName”和“venueTown”吗?
{
"aggs": {
"query": {
"terms": {
"field": "name"
}
,
"aggs": {
"top": {
"top_hits": {
"size": 1
}
}
}
}
},
"size": 0,
"query": {
"multi_match": {
"query": "LAURA",
"operator": "OR",
"fields": [
"name",
"venueName",
"venueTown"
]
}
}
}
答案 0 :(得分:1)
如果我理解正确,您可以使用热门点击编写多个聚合。
Calendar cal = Calendar.getInstance();
PendingIntent pintent = PendingIntent.getService(this, 0, new Intent(this, MyService.class), 0);
cal.set(Calendar.MINUTE, MINUTE);
cal.set(Calendar.HOUR_OF_DAY, HOUR);
cal.add(Calendar.DAY_OF_YEAR,1);
AlarmManager alarm = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
alarm.setRepeating(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), 86400000, pintent);
running = true;