• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ScriptEngineService类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.elasticsearch.script.ScriptEngineService的典型用法代码示例。如果您正苦于以下问题:Java ScriptEngineService类的具体用法?Java ScriptEngineService怎么用?Java ScriptEngineService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: testJsonEscapeEncoder

import org.elasticsearch.script.ScriptEngineService; //导入依赖的package包/类
public void testJsonEscapeEncoder() {
    final ScriptEngineService engine = new MustacheScriptEngineService();
    final Map<String, String> params = randomBoolean() ? singletonMap(Script.CONTENT_TYPE_OPTION, JSON_MIME_TYPE) : emptyMap();

    Mustache script = (Mustache) engine.compile(null, "{\"field\": \"{{value}}\"}", params);
    CompiledScript compiled = new CompiledScript(INLINE, null, MustacheScriptEngineService.NAME, script);

    ExecutableScript executable = engine.executable(compiled, singletonMap("value", "a \"value\""));
    BytesReference result = (BytesReference) executable.run();
    assertThat(result.utf8ToString(), equalTo("{\"field\": \"a \\\"value\\\"\"}"));
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:12,代码来源:CustomMustacheFactoryTests.java


示例2: testDefaultEncoder

import org.elasticsearch.script.ScriptEngineService; //导入依赖的package包/类
public void testDefaultEncoder() {
    final ScriptEngineService engine = new MustacheScriptEngineService();
    final Map<String, String> params = singletonMap(Script.CONTENT_TYPE_OPTION, PLAIN_TEXT_MIME_TYPE);

    Mustache script = (Mustache) engine.compile(null, "{\"field\": \"{{value}}\"}", params);
    CompiledScript compiled = new CompiledScript(INLINE, null, MustacheScriptEngineService.NAME, script);

    ExecutableScript executable = engine.executable(compiled, singletonMap("value", "a \"value\""));
    BytesReference result = (BytesReference) executable.run();
    assertThat(result.utf8ToString(), equalTo("{\"field\": \"a \"value\"\"}"));
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:12,代码来源:CustomMustacheFactoryTests.java


示例3: testUrlEncoder

import org.elasticsearch.script.ScriptEngineService; //导入依赖的package包/类
public void testUrlEncoder() {
    final ScriptEngineService engine = new MustacheScriptEngineService();
    final Map<String, String> params = singletonMap(Script.CONTENT_TYPE_OPTION, X_WWW_FORM_URLENCODED_MIME_TYPE);

    Mustache script = (Mustache) engine.compile(null, "{\"field\": \"{{value}}\"}", params);
    CompiledScript compiled = new CompiledScript(INLINE, null, MustacheScriptEngineService.NAME, script);

    ExecutableScript executable = engine.executable(compiled, singletonMap("value", "tilde~ AND date:[2016 FROM*]"));
    BytesReference result = (BytesReference) executable.run();
    assertThat(result.utf8ToString(), equalTo("{\"field\": \"tilde%7E+AND+date%3A%5B2016+FROM*%5D\"}"));
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:12,代码来源:CustomMustacheFactoryTests.java


示例4: getScriptEngineService

import org.elasticsearch.script.ScriptEngineService; //导入依赖的package包/类
@Override
public ScriptEngineService getScriptEngineService(Settings settings) {
    return new ExpressionScriptEngineService(settings);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:ExpressionPlugin.java


示例5: getScriptEngineService

import org.elasticsearch.script.ScriptEngineService; //导入依赖的package包/类
@Override
public ScriptEngineService getScriptEngineService(Settings settings) {
    return new MustacheScriptEngineService();
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:MustachePlugin.java


示例6: getScriptEngineService

import org.elasticsearch.script.ScriptEngineService; //导入依赖的package包/类
@Override
public ScriptEngineService getScriptEngineService(Settings settings) {
    return new PainlessScriptEngineService(settings);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:PainlessPlugin.java


示例7: getScriptEngineService

import org.elasticsearch.script.ScriptEngineService; //导入依赖的package包/类
/**
 * Returns a {@link ScriptEngineService} instance or <code>null</code> if this plugin doesn't add a new script engine
 */
default ScriptEngineService getScriptEngineService(Settings settings) {
    return null;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:7,代码来源:ScriptPlugin.java


示例8: getScriptEngineService

import org.elasticsearch.script.ScriptEngineService; //导入依赖的package包/类
@Override
public ScriptEngineService getScriptEngineService(Settings settings) {
    return new PutFieldValuesScriptEngine();
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:UpdateIT.java


示例9: getScriptEngineService

import org.elasticsearch.script.ScriptEngineService; //导入依赖的package包/类
@Override
public ScriptEngineService getScriptEngineService(Settings settings) {
    return new ExtractFieldScriptEngine();
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:SumIT.java


示例10: getScriptEngineService

import org.elasticsearch.script.ScriptEngineService; //导入依赖的package包/类
@Override
public ScriptEngineService getScriptEngineService(Settings settings) {
    return new FieldValueScriptEngine();
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:ValueCountIT.java


示例11: getScriptEngineService

import org.elasticsearch.script.ScriptEngineService; //导入依赖的package包/类
@Override
public ScriptEngineService getScriptEngineService(Settings settings) {
    return new DummyTemplateScriptEngine();
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:SuggestSearchIT.java


示例12: getScriptEngineService

import org.elasticsearch.script.ScriptEngineService; //导入依赖的package包/类
public final ScriptEngineService getScriptEngineService(Settings settings) {
    return new VectorScoringScriptEngineService(settings);
}
 
开发者ID:lior-k,项目名称:fast-elasticsearch-vector-scoring,代码行数:4,代码来源:VectorScoringPlugin.java


示例13: getScriptEngineService

import org.elasticsearch.script.ScriptEngineService; //导入依赖的package包/类
@Override
public ScriptEngineService getScriptEngineService(Settings settings) {
    // you can add a new script engine, or you can use settings to get defined values
    // String redisHost = settings.get("redis.host", "127.0.0.1");
    return null;
}
 
开发者ID:ishare,项目名称:elasticsearch-native-script-template,代码行数:7,代码来源:NativeScriptPlugin.java


示例14: getScriptEngineService

import org.elasticsearch.script.ScriptEngineService; //导入依赖的package包/类
@Override
public ScriptEngineService getScriptEngineService(Settings settings) {
    return new RankLibScriptEngine(settings, parserFactory);
}
 
开发者ID:o19s,项目名称:elasticsearch-learning-to-rank,代码行数:5,代码来源:LtrQueryParserPlugin.java


示例15: getScriptEngineService

import org.elasticsearch.script.ScriptEngineService; //导入依赖的package包/类
@Override
public ScriptEngineService getScriptEngineService(Settings settings) {
    return new PMMLModelScriptEngineService(settings);
}
 
开发者ID:brwe,项目名称:es-token-plugin,代码行数:5,代码来源:TokenPlugin.java


示例16: getScriptEngineService

import org.elasticsearch.script.ScriptEngineService; //导入依赖的package包/类
@Override
public ScriptEngineService getScriptEngineService(final Settings settings) {
    return new DiversitySortScriptEngineService(settings);
}
 
开发者ID:codelibs,项目名称:elasticsearch-dynarank,代码行数:5,代码来源:DynamicRankingPlugin.java


示例17: getScriptEngineService

import org.elasticsearch.script.ScriptEngineService; //导入依赖的package包/类
@Override
public ScriptEngineService getScriptEngineService(final Settings settings) {
    scriptEngineService = new VelocityScriptEngineService(settings);
    return scriptEngineService;
}
 
开发者ID:codelibs,项目名称:elasticsearch-lang-velocity,代码行数:6,代码来源:VelocityPlugin.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java StepInterpolator类代码示例发布时间:2022-05-22
下一篇:
Java AuthnRequest类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap