public class TemplateQueryParser extends Object implements QueryParser
Modifier and Type | Field and Description |
---|---|
static String |
NAME
Name to reference this type of query.
|
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 Template |
parse(String defaultLang,
XContentParser parser,
ParseFieldMatcher parseFieldMatcher,
String... parameters) |
static Template |
parse(XContentParser parser,
Map<String,ScriptService.ScriptType> parameterMap,
ParseFieldMatcher parseFieldMatcher) |
static Template |
parse(XContentParser parser,
ParseFieldMatcher parseFieldMatcher) |
static Template |
parse(XContentParser parser,
ParseFieldMatcher parseFieldMatcher,
String... parameters) |
public static final String NAME
public static final String QUERY
@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 Template parse(XContentParser parser, ParseFieldMatcher parseFieldMatcher, String... parameters) throws IOException
IOException
public static Template parse(String defaultLang, XContentParser parser, ParseFieldMatcher parseFieldMatcher, String... parameters) throws IOException
IOException
public static Template parse(XContentParser parser, ParseFieldMatcher parseFieldMatcher) throws IOException
IOException
public static Template parse(XContentParser parser, Map<String,ScriptService.ScriptType> parameterMap, ParseFieldMatcher parseFieldMatcher) throws IOException
IOException
Copyright © 2009–2016. All rights reserved.