Elasticsearch 搜索数组字段
参考文章:Elasticsearch 搜索数组字段_hhhzua的专栏-CSDN博客_elasticsearch 查询数组1、搜索 数组字段tags中同时存在元素str_a、str_b{"query": {"bool": {"filter": [{"term": {"tags": "str_a"}},{"term":...
·
参考文章:Elasticsearch 搜索数组字段_hhhzua的专栏-CSDN博客_elasticsearch 查询数组
1、搜索 数组字段 tags
中同时存在元素 str_a
、str_b
{
"query": {
"bool": {
"filter": [
{
"term": {
"tags": "str_a"
}
},
{
"term": {
"tags": "str_b"
}
}
]
}
}
}
2、搜索 数组字段 tags
中存在元素 str_a
或 str_b
{
"query": {
"bool": {
"filter": [
{
"terms": {
"tags": [
"str_a",
"str_b"
]
}
}
]
}
}
}
更多推荐
已为社区贡献27条内容
所有评论(0)