gpt4 book ai didi

elasticsearch - Elasticsearch 聚合始于

转载 作者:行者123 更新时间:2023-12-03 00:55:10 25 4
gpt4 key购买 nike

有没有一种方法可以将过滤器添加到terms聚合中,这样我就只能从某些字符串开始过滤?

我从这里开始:

{
"query": {
"match_all": {}
},
"aggs": {
"address": {
"terms": {
"field": "address"
}
}
}
}

最佳答案

使用 include or exclude parameters:

{
"query": {
"match_all": {}
},
"aggs": {
"address": {
"terms": {
"field": "address",
"include": "Main.*" <-- add this
}
}
}
}

关于elasticsearch - Elasticsearch 聚合始于,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45550367/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com