Java Code Examples for org.elasticsearch.script.ScriptType#STORED

The following examples show how to use org.elasticsearch.script.ScriptType#STORED . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DynamicRanker.java    From elasticsearch-dynarank with Apache License 2.0 5 votes vote down vote up
ScriptInfo(final String script, final String lang, final String scriptType, final Settings settings, final int reorderSize) {
    this.script = script;
    this.lang = lang;
    this.reorderSize = reorderSize;
    this.settings = new HashMap<>();
    for (final String name : settings.keySet()) {
        final List<String> list = settings.getAsList(name);
        this.settings.put(name, list.toArray(new String[list.size()]));
    }
    if ("STORED".equalsIgnoreCase(scriptType)) {
        this.scriptType = ScriptType.STORED;
    } else {
        this.scriptType = ScriptType.INLINE;
    }
}
 
Example 2
Source File: ScriptFilter.java    From elasticsearch-sql with Apache License 2.0 5 votes vote down vote up
private void parseAndUpdateScriptType(String scriptType) {
    String scriptTypeUpper = scriptType.toUpperCase();
    switch(scriptTypeUpper){
        case "INLINE":
            this.scriptType = ScriptType.INLINE;
            break;
        case "INDEXED":
        case "STORED":
            this.scriptType = ScriptType.STORED;
            break;
    }
}