Link Search Menu Expand Document Documentation Menu

获取脚本语言

1.0 版引入

获取脚本语言 API 操作检索所有支持的脚本语言及其可用上下文。

请求示例

GET _script_language

示例响应

GET _script_language 请求返回每种语言的可用上下文

{
  "types_allowed" : [
    "inline",
    "stored"
  ],
  "language_contexts" : [
    {
      "language" : "expression",
      "contexts" : [
        "aggregation_selector",
        "aggs",
        "bucket_aggregation",
        "field",
        "filter",
        "number_sort",
        "score",
        "terms_set"
      ]
    },
    {
      "language" : "mustache",
      "contexts" : [
        "template"
      ]
    },
    {
      "language" : "opensearch_query_expression",
      "contexts" : [
        "aggs",
        "filter"
      ]
    },
    {
      "language" : "painless",
      "contexts" : [
        "aggregation_selector",
        "aggs",
        "aggs_combine",
        "aggs_init",
        "aggs_map",
        "aggs_reduce",
        "analysis",
        "bucket_aggregation",
        "field",
        "filter",
        "ingest",
        "interval",
        "moving-function",
        "number_sort",
        "painless_test",
        "processor_conditional",
        "score",
        "script_heuristic",
        "similarity",
        "similarity_weight",
        "string_sort",
        "template",
        "terms_set",
        "trigger",
        "update"
      ]
    }
  ]
}

响应正文字段

该请求包含以下响应字段。

字段 数据类型 描述
types_allowed 字符串列表 启用的脚本类型,由 script.allowed_types 设置确定。可能包含 inline 和/或 stored
language_contexts 对象列表 一个对象列表,每个对象将一种受支持的语言映射到其可用上下文。
language_contexts.language 字符串 注册的脚本语言的名称。
language_contexts.contexts 字符串列表 该语言的所有上下文列表,由 script.allowed_contexts 设置确定。
剩余 350 字符

有问题?

想贡献?