{
"size": 0,
"query": {
"bool": {
"must": [
{
"match": {
"web_code": "P" // how to write multiple codes here
}
}
]
}
}
}
以上对于单个值来说工作得很好。如何使用 Must 语法获取多个 Web 代码..?
您可以使用
terms
查询而不是 match
来完成此操作:
{
"size": 0,
"query": {
"bool": {
"must": [
{
"terms": {
"web_code": ["P", "R", "S", "T"]
}
}
]
}
}
}