gpt4 book ai didi

php - Elasticsearch post_filter

转载 作者:行者123 更新时间:2023-12-02 22:46:31 24 4
gpt4 key购买 nike

有什么方法可以对Elasticsearch中的post_filter应用多个条件?

GET /job/_search
{
"post_filter":
{
"terms": {
"expertise_level": [
"medium",
"high"
]
}
},
"aggs": {
"expertise_level": {
"terms": {
"field": "expertise_level",
"size": 10
}
}
}
}


这会起作用。但是我想向查询添加多个过滤器。我该如何实现?

最佳答案

使用bool子句:

{
"post_filter": {
"bool": {
"must": [
{
//Add Filter 1
},
{
//Add Filter 2
},
{
//Add Filter 3
}
]
}
}
}

关于php - Elasticsearch post_filter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37458152/

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