当前位置: 代码迷 >> 综合 >> 使用kibana查询elasticsearch嵌套对象之嵌套类型
  详细解决方案

使用kibana查询elasticsearch嵌套对象之嵌套类型

热度:47   发布时间:2023-09-19 18:28:16.0

 

user字段映射为nested类型,而不是默认的object类型


curl -XGET 'localhost:9200/my_index/_search?pretty' -H 'Content-Type: application/json' -d'
{"query": {"nested": {"path": "user","query": {"bool": {"must": [{ "match": { "user.first": "Alice" }},{ "match": { "user.last":  "Smith" }} ]}}}}
}

GET uat-buriedpoint_xfs.com-2021-11/_search
{
  "query": {
    "bool": {
      "must": [
        { "match": { "body.buriedPointInfo.userInfo.sid": "1b5bd8a4787445b1a8ab7061d24e98d5" }},
        { "match": { "body.buriedPointInfo.requestInfo.url": "/auth/user/getUserRoles" }}
        
      ]
    }
  }
}

  相关解决方案