zoukankan      html  css  js  c++  java
  • es elasticsearch mapping parameters enabled

    enabled 特点

    image

    enabled 使用

    # enabled
    PUT /enabled_test
    {
      "mappings" : {
        "properties" : {
          "name" : {
            "type" : "keyword"
          },
          "title" : {
            "type"    : "object",
            "enabled" : false
          }
        }
      }
    }
    
    # 索引
    POST /enabled_test/_doc/1
    {
      "name"  : "hello",
      "title" : "name"
    }
    
    # 搜索 可以检索到
    GET /enabled_test/_search
    
    # 结果
    {
      "took" : 0,
      "timed_out" : false,
      "_shards" : {
        "total" : 1,
        "successful" : 1,
        "skipped" : 0,
        "failed" : 0
      },
      "hits" : {
        "total" : {
          "value" : 1,
          "relation" : "eq"
        },
        "max_score" : 1.0,
        "hits" : [
          {
            "_index" : "enabled_test",
            "_type" : "_doc",
            "_id" : "1",
            "_score" : 1.0,
            "_source" : {
              "name" : "hello",
              "title" : "name"
            }
          }
        ]
      }
    }
    
    # 搜索 不能被搜索
    GET /enabled_test/_search
    {
      "query" : {
        "match" : {
          "title" : "name"
        }
      }
    }
    
    # 结果
    {
      "took" : 0,
      "timed_out" : false,
      "_shards" : {
        "total" : 1,
        "successful" : 1,
        "skipped" : 0,
        "failed" : 0
      },
      "hits" : {
        "total" : {
          "value" : 0,
          "relation" : "eq"
        },
        "max_score" : null,
        "hits" : [ ]
      }
    }
    
    # enable 整体设置为false
    PUT /enabled_test_1
    {
      "mappings" : {
        "enabled" : false
      }
    }
    
    # 索引
    POST /enabled_test_1/_doc/1
    {
      "name" : "hello"
    }
    
    # 搜索 不能被搜索到
    GET /enabled_test_1/_search
    {
      "query" : {
        "match" : {
          "name" : "hello"
        }
      }
    }
    
    # 结果
    {
      "took" : 0,
      "timed_out" : false,
      "_shards" : {
        "total" : 1,
        "successful" : 1,
        "skipped" : 0,
        "failed" : 0
      },
      "hits" : {
        "total" : {
          "value" : 0,
          "relation" : "eq"
        },
        "max_score" : null,
        "hits" : [ ]
      }
    }
    
  • 相关阅读:
    shell脚本积累
    while,shift,until,case
    条件测试命令,if命令,双圆括号,双中括号
    seq命令,tr命令,sort命令,cut命令
    正则,grep命令详解
    Ansible实现批量管理服务器
    实时同步服务知识梳理
    RHEL7破解密码操作步骤
    运维核心基础知识之——MD5sum校验文件
    Linux运维基础提高之RAID卡和磁盘分区
  • 原文地址:https://www.cnblogs.com/aze999/p/15765930.html
Copyright © 2011-2022 走看看