用于Long类型(ES 5.0.4)的ElasticSearch上的嵌套查询

问题描述 投票:0回答:1

这是我关于堆栈溢出的第一个问题,请原谅我的错误。以后我会改进它们。我也是Elastic Search的新手。好的,我正在尝试在弹性搜索(5.0.4)中进行精确匹配。该请求将返回存在的所有文档,而不是进行完全匹配。不确定这种行为。

这里是映射

{
   "properties":{
      "debug_urls":{
         "properties":{
            "characteristics":{
               "type":"text",
               "fields":{
                  "keyword":{
                     "type":"keyword",
                     "ignore_above":256
                  }
               }
            },
            "url_id":{
               "type":"long"
            }
         },
         "type":"nested"
      },
      "scanId":{
         "type":"text",
         "fields":{
            "keyword":{
               "type":"keyword",
               "ignore_above":256
            }
         }
      }
   }
}

这是我的要求。

{
    "query": {
        "nested": {
           "path": "debug_urls",
           "query": {
               "match": {
                  "debug_urls.url_id": 1
               }
           }
        }
    }
}
elasticsearch elasticsearch-5 elasticsearch-query
1个回答
0
投票

如果只想查看符合条件的嵌套文档,则可以利用nested inner_hits

inner_hits
© www.soinside.com 2019 - 2024. All rights reserved.