zoukankan      html  css  js  c++  java
  • es 数组追加

    POST test_index/test_type/1/_update
    {
       "script" : {
           "inline": "ctx._source.tags.add(params.new_tag)",
           "params" : {
              "new_tag" : "tag4"
           }
       }
    }

     增加字段

    awemeuser/_mapping 
    {
      "properties": {
        "total_pro_share": {
          "type": "long"
        },
        "total_pro_comment": {
          "type": "long"
        },
        "total_pro_favorite": {
          "type": "long"
        }
      }
    }

    设置默认值

    http://localhost:9200/awemeuser/_update_by_query
    {
      "script": {
        "lang": "painless",
        "source": "if (ctx._source.total_pro_share== null) {ctx._source.total_pro_share= 0}"
      }
    }

     修改副本数 put

    http://localhost:9200/awemeincr202107/_settings
    {"number_of_replicas":0}
  • 相关阅读:

    list集合
    接口
    抽取对象的基本方法
    访问修饰符
    构造方法
    如何弹出一个对话框
    nginx反代配置
    TreeMap排序
    BeanPropertyRowMapper
  • 原文地址:https://www.cnblogs.com/elsons/p/14898169.html
Copyright © 2011-2022 走看看