我有一个对business_process字段进行过滤的elasticsearch查询。我想添加另一个match子句,以便两个字段都具有指定的数据,并且我想在business_process字段上添加突出显示。我该怎么做呢?先感谢您。
{
"query": {
"filtered": {
"query": {
"match": {
"business_process": "loading"
}
},
"filter": {
"missing": {
"field": "client_cru_all"
}
}
}
}
}
最佳答案
ES文档是您的 friend 。 bool query可能就是您想要的。这样的事情应该做你想要的。
POST /test_index/_search
{
"query": {
"filtered": {
"query": {
"bool": {
"must": [
{
"match": {
"business_process": "loading"
}
},
{
"match": {
"another_field": "some text"
}
}
]
}
},
"filter": {
"missing": {
"field": "client_cru_all"
}
}
}
}
}
就突出显示而言,我将开始here。如果您无法使用它,请发布您在问题中尝试过的内容。
关于elasticsearch - 如何在此Elasticsearch查询中添加其他条件进行过滤?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33531807/