当前位置: 首页>>代码示例>>Java>>正文


Java Script.DEFAULT_TEMPLATE_LANG属性代码示例

本文整理汇总了Java中org.elasticsearch.script.Script.DEFAULT_TEMPLATE_LANG属性的典型用法代码示例。如果您正苦于以下问题:Java Script.DEFAULT_TEMPLATE_LANG属性的具体用法?Java Script.DEFAULT_TEMPLATE_LANG怎么用?Java Script.DEFAULT_TEMPLATE_LANG使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.elasticsearch.script.Script的用法示例。


在下文中一共展示了Script.DEFAULT_TEMPLATE_LANG属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: prepareRequest

@Override
public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException {
    String id = request.param("id");
    BytesReference content = request.content();

    PutStoredScriptRequest put = new PutStoredScriptRequest(id, Script.DEFAULT_TEMPLATE_LANG, content, request.getXContentType());
    return channel -> client.admin().cluster().putStoredScript(put, new AcknowledgedRestListener<>(channel));
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:8,代码来源:RestPutSearchTemplateAction.java

示例2: prepareRequest

@Override
public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException {
    String id = request.param("id");

    DeleteStoredScriptRequest deleteStoredScriptRequest = new DeleteStoredScriptRequest(id, Script.DEFAULT_TEMPLATE_LANG);
    return channel -> client.admin().cluster().deleteStoredScript(deleteStoredScriptRequest, new AcknowledgedRestListener<>(channel));
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:7,代码来源:RestDeleteSearchTemplateAction.java

示例3: prepareRequest

@Override
public RestChannelConsumer prepareRequest(final RestRequest request, NodeClient client) throws IOException {
    String id = request.param("id");

    GetStoredScriptRequest getRequest = new GetStoredScriptRequest(id, Script.DEFAULT_TEMPLATE_LANG);

    return channel -> client.admin().cluster().getStoredScript(getRequest, new RestBuilderListener<GetStoredScriptResponse>(channel) {
        @Override
        public RestResponse buildResponse(GetStoredScriptResponse response, XContentBuilder builder) throws Exception {
            builder.startObject();
            builder.field(_ID_PARSE_FIELD.getPreferredName(), id);

            builder.field(StoredScriptSource.LANG_PARSE_FIELD.getPreferredName(), Script.DEFAULT_TEMPLATE_LANG);

            StoredScriptSource source = response.getSource();
            boolean found = source != null;
            builder.field(FOUND_PARSE_FIELD.getPreferredName(), found);

            if (found) {
                builder.field(StoredScriptSource.TEMPLATE_PARSE_FIELD.getPreferredName(), source.getCode());
            }

            builder.endObject();

            return new BytesRestResponse(found ? RestStatus.OK : RestStatus.NOT_FOUND, builder);
        }
    });
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:28,代码来源:RestGetSearchTemplateAction.java


注:本文中的org.elasticsearch.script.Script.DEFAULT_TEMPLATE_LANG属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。