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

The following examples show how to use org.elasticsearch.script.ScriptService#ScriptType . 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: TemplateQueryParser.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
public static Template parse(XContentParser parser, ParseFieldMatcher parseFieldMatcher, String... parameters) throws IOException {

        Map<String, ScriptService.ScriptType> parameterMap = new HashMap<>(parametersToTypes);
        for (String parameter : parameters) {
            parameterMap.put(parameter, ScriptService.ScriptType.INLINE);
        }
        return parse(parser, parameterMap, parseFieldMatcher);
    }
 
Example 2
Source File: TemplateQueryParser.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
public static Template parse(String defaultLang, XContentParser parser, ParseFieldMatcher parseFieldMatcher, String... parameters) throws IOException {

        Map<String, ScriptService.ScriptType> parameterMap = new HashMap<>(parametersToTypes);
        for (String parameter : parameters) {
            parameterMap.put(parameter, ScriptService.ScriptType.INLINE);
        }
        return Template.parse(parser, parameterMap, defaultLang, parseFieldMatcher);
    }
 
Example 3
Source File: TemplateQueryParser.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
public static Template parse(XContentParser parser, Map<String, ScriptService.ScriptType> parameterMap, ParseFieldMatcher parseFieldMatcher) throws IOException {
    return Template.parse(parser, parameterMap, parseFieldMatcher);
}
 
Example 4
Source File: QueryBuilders.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
/**
 * Facilitates creating template query requests
 */
public static TemplateQueryBuilder templateQuery(String template, ScriptService.ScriptType templateType, Map<String, Object> vars) {
    return new TemplateQueryBuilder(template, templateType, vars);
}
 
Example 5
Source File: UpdateRequest.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
/**
 * @deprecated Use {@link #script()} instead
 */
@Deprecated
public ScriptService.ScriptType scriptType() {
    return this.script == null ? null : this.script.getType();
}
 
Example 6
Source File: SearchRequestBuilder.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
/**
 * @deprecated Use {@link #setTemplate(Template)} instead.
 */
@Deprecated
public SearchRequestBuilder setTemplateType(ScriptService.ScriptType templateType) {
    request.templateType(templateType);
    return this;
}
 
Example 7
Source File: TemplateQueryBuilder.java    From Elasticsearch with Apache License 2.0 3 votes vote down vote up
/**
 * @param template
 *            the template to use for that query.
 * @param vars
 *            the parameters to fill the template with.
 * @param templateType
 *            what kind of template (INLINE,FILE,ID)
 * @deprecated Use {@link #TemplateQueryBuilder(Template)} instead.
 * */
@Deprecated
public TemplateQueryBuilder(String template, ScriptService.ScriptType templateType, Map<String, Object> vars) {
    this.templateString = template;
    this.vars = vars;
    this.templateType = templateType;
}
 
Example 8
Source File: SearchRequest.java    From Elasticsearch with Apache License 2.0 2 votes vote down vote up
/**
 * The name of the stored template
 * 
 * @deprecated use {@link #template()} instead.
 */
@Deprecated
public ScriptService.ScriptType templateType() {
    return template == null ? null : template.getType();
}