zoukankan      html  css  js  c++  java
  • es调用脚本

    1、内部脚本("script" : "ctx._source" 是内部定义好的获取_source数据的方式,不用改变)
    POST /index/type/id/_update
    {
      "script" : "ctx._source.field=any_result"
    }

    2、外部脚本
    定义一个外部脚本,名称为aa.groovy,脚本内容为ctx._source.num+=new_num
    POST /test_index/test_type/id/_update
    {
      "script" : {
        "lang" : "groovy",
        "file" : "aa",
        "params" : {
          "new_num" : 1
        }
      }
    }

    3、用脚本删除文档
    定义一个外部脚本,名称为test_delete.groovy,脚本内容为 ctx.op = ctx._source.num == count ? 'delete' : 'none'
    POST /test_index/test_type/id/_update
    {
      "script" : {
        "lang" : "groovy",
        "file" : "test_delete",
        "params" : {
          "count" : 1
        }
      }
    }

  • 相关阅读:
    UnityShader
    Unity
    Tools
    linux下解压命令
    进程 同步、互斥
    I/O模型
    jclass jobject
    javah javap
    IDA 结构体
    Windows CSRSS API List (NT/2000/XP/2003/Vista/2008/7/2012/8)
  • 原文地址:https://www.cnblogs.com/qinjf/p/8506341.html
Copyright © 2011-2022 走看看