org.elasticsearch.script.Script.toXContent()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(3.9k)|赞(0)|评价(0)|浏览(147)

本文整理了Java中org.elasticsearch.script.Script.toXContent()方法的一些代码示例,展示了Script.toXContent()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Script.toXContent()方法的具体详情如下:
包路径:org.elasticsearch.script.Script
类名称:Script
方法名:toXContent

Script.toXContent介绍

[英]This will build scripts into the following XContent structure: "" : "",, "params" : "param0" : "", "param1" : "", ... } } } Example: "source" : "return Math.log(doc.popularity) * params.multiplier;",} } Note that lang, options, and params will only be included if there have been any specified. This also handles templates in a special way. If the Script#CONTENT_TYPE_OPTION option is provided and the ScriptType#INLINE is specified then the template will be preserved as a raw field. "source" : { "query" : ... }, "lang" : "", "options" : "option0" : "", "option1" : "", ... }, "params" : "param0" : "", "param1" : "", ... } } }
[中]这将把脚本构建到以下XContent结构中:“:”,“params”:“param0”:“param1”:“…}”示例:“source”:“return Math.log(doc.popularity)*params.multiplier;”,}注意,lang、options和params只有在有任何指定的情况下才会被包括在内。这也以一种特殊的方式处理模板。如果提供了脚本#内容#类型#选项,并指定了脚本类型#内联,则模板将保留为原始字段。“来源”:{“查询”:…},“lang”:“options”:“option0”:“option1”:“…”,“params”:“param0”:“param1”:“…}}”

代码示例

代码示例来源:origin: org.elasticsearch/elasticsearch

@Override
public XContentBuilder toXContent(XContentBuilder builder, Params builderParams) throws IOException {
  builder.startObject(NAME);
  builder.field(Script.SCRIPT_PARSE_FIELD.getPreferredName());
  script.toXContent(builder, builderParams);
  builder.endObject();
  return builder;
}

代码示例来源:origin: org.elasticsearch/elasticsearch

@Override
  public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
    builder.startObject();
    if (getScript() != null) {
      builder.field("script");
      getScript().toXContent(builder, params);
    }
    getSearchRequest().source().innerToXContent(builder, params);
    builder.endObject();
    return builder;
  }
}

代码示例来源:origin: harbby/presto-connectors

@Override
  public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
    return script.toXContent(builder, params);
  }
}

代码示例来源:origin: apache/servicemix-bundles

@Override
public XContentBuilder toXContent(XContentBuilder builder, Params builderParams) throws IOException {
  builder.startObject(NAME);
  builder.field(Script.SCRIPT_PARSE_FIELD.getPreferredName());
  script.toXContent(builder, builderParams);
  builder.endObject();
  return builder;
}

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

@Override
public XContentBuilder toXContent(XContentBuilder builder, Params builderParams) throws IOException {
  builder.startObject(NAME);
  builder.field(Script.SCRIPT_PARSE_FIELD.getPreferredName());
  script.toXContent(builder, builderParams);
  builder.endObject();
  return builder;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

@Override
public XContentBuilder toXContent(XContentBuilder builder, Params builderParams) throws IOException {
  builder.startObject(NAME);
  builder.field(Script.SCRIPT_PARSE_FIELD.getPreferredName());
  script.toXContent(builder, builderParams);
  builder.endObject();
  return builder;
}

代码示例来源:origin: harbby/presto-connectors

@Override
public XContentBuilder toXContent(XContentBuilder builder, Params builderParams) throws IOException {
  builder.startObject(STREAM.getName());
  builder.field(ScriptField.SCRIPT.getPreferredName());
  script.toXContent(builder, builderParams);
  builder.endObject();
  return builder;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

@Override
  public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
    builder.startObject();
    if (getScript() != null) {
      builder.field("script");
      getScript().toXContent(builder, params);
    }
    getSearchRequest().source().innerToXContent(builder, params);
    builder.endObject();
    return builder;
  }
}

相关文章