zoukankan      html  css  js  c++  java
  • 存在与否检索 exists query

    返回包含字段索引值的文档。

    由于多种原因,文档字段的索引值可能不存在:

    • 源JSON中的字段是null[]
    • 该字段已"index" : false在映射中设置
    • 字段值的长度超出ignore_above了映射中设置
    • 字段值格式错误,并且ignore_malformed已在映射中定义
    curl -X GET "localhost:9200/_search?pretty" -H 'Content-Type: application/json' -d'
    {
      "query": {
        "exists": {
          "field": "user"
        }
      }
    }
    '

    要查找缺少字段索引值的文档,请 查询中使用must_not exists查询。

    以下搜索返回缺少该user.id字段的索引值的文档

    curl -X GET "localhost:9200/_search?pretty" -H 'Content-Type: application/json' -d'
    {
      "query": {
        "bool": {
          "must_not": {
            "exists": {
              "field": "user.id"
            }
          }
        }
      }
    }
    '
  • 相关阅读:
    元素显示v-show
    条件渲染v-if
    v-bind:class
    Class绑定v-bind:class
    设定计算属性setter
    观察属性$watch
    计算属性computed
    过滤器filters
    jk_proxy实现apache+tomcat负载均衡
    (WPF)Storyboard
  • 原文地址:https://www.cnblogs.com/Mint-diary/p/14498234.html
Copyright © 2011-2022 走看看