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


Java ScriptEngineService类代码示例

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


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


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