1,使用inculde 以及exclude 过滤
{
"query": {
"bool": {
"should": [
{
"range": {
"PUBDATE": {
"gte": "now-1y/d",
"lte": "now-1y+12h"
}
}
}],
"must": [
]
}
},
"_source": {
"includes": ["PUBDATE"]
},
"size": 0,
"from": 0,
"sort": [{
"PUBDATE": "desc"
}],
"aggs": {
"aggsresult": {
"terms": {
"field": "WEBSITE",
"size": 10,
"include": "东北新闻网"
}
}
}
}
结果:
下篇文章更新使用bucket_selector 过滤
欢迎关注公众号