public class TemplateQueryParser extends Object implements QueryParser
Modifier and Type | Class and Description |
---|---|
static class |
TemplateQueryParser.TemplateContext |
Modifier and Type | Field and Description |
---|---|
static String |
NAME
Name to reference this type of query.
|
static String |
PARAMS
Name of query parameter containing the template parameters.
|
static String |
QUERY
Name of query parameter containing the template string.
|
Constructor and Description |
---|
TemplateQueryParser(ScriptService scriptService) |
Modifier and Type | Method and Description |
---|---|
String[] |
names()
The names this query parser is registered under.
|
org.apache.lucene.search.Query |
parse(QueryParseContext parseContext)
Parses the template query replacing template parameters with provided values.
|
static TemplateQueryParser.TemplateContext |
parse(XContentParser parser,
String paramsFieldname) |
static TemplateQueryParser.TemplateContext |
parse(XContentParser parser,
String paramsFieldname,
Map<String,ScriptService.ScriptType> parameterMap) |
static TemplateQueryParser.TemplateContext |
parse(XContentParser parser,
String paramsFieldname,
String... parameters) |
public static final String NAME
public static final String QUERY
public static final String PARAMS
@Inject public TemplateQueryParser(ScriptService scriptService)
public String[] names()
QueryParser
names
in interface QueryParser
@Nullable public org.apache.lucene.search.Query parse(QueryParseContext parseContext) throws IOException
parse
in interface QueryParser
parseContext
- parse context containing the templated query.IOException
public static TemplateQueryParser.TemplateContext parse(XContentParser parser, String paramsFieldname, String... parameters) throws IOException
IOException
public static TemplateQueryParser.TemplateContext parse(XContentParser parser, String paramsFieldname) throws IOException
IOException
public static TemplateQueryParser.TemplateContext parse(XContentParser parser, String paramsFieldname, Map<String,ScriptService.ScriptType> parameterMap) throws IOException
IOException
Copyright © 2009–2015. All rights reserved.