public class QueryRewriteContext
extends java.lang.Object
QueryBuilder
instances into simplified version.Modifier and Type | Field and Description |
---|---|
protected Client |
client |
protected IndexSettings |
indexSettings |
protected MapperService |
mapperService |
protected java.util.function.LongSupplier |
nowInMillis |
protected org.apache.lucene.index.IndexReader |
reader |
protected ScriptService |
scriptService |
Constructor and Description |
---|
QueryRewriteContext(IndexSettings indexSettings,
MapperService mapperService,
ScriptService scriptService,
NamedXContentRegistry xContentRegistry,
Client client,
org.apache.lucene.index.IndexReader reader,
java.util.function.LongSupplier nowInMillis) |
Modifier and Type | Method and Description |
---|---|
Client |
getClient()
Returns a clients to fetch resources from local or remove nodes.
|
org.apache.lucene.index.IndexReader |
getIndexReader()
Return the current
IndexReader , or null if no index reader is available, for
instance if we are on the coordinating node or if this rewrite context is used to index
queries (percolation). |
IndexSettings |
getIndexSettings()
Returns the index settings for this context.
|
MapperService |
getMapperService()
Return the MapperService.
|
BytesReference |
getTemplateBytes(Script template) |
NamedXContentRegistry |
getXContentRegistry()
The registry used to build new
XContentParser s. |
QueryParseContext |
newParseContext(XContentParser parser)
Returns a new
QueryParseContext that wraps the provided parser. |
QueryParseContext |
newParseContextWithLegacyScriptLanguage(XContentParser parser)
Returns a new
QueryParseContext like newParseContext(XContentParser) with the only diffence, that
the default script language will default to what has been set in the 'script.legacy.default_lang' setting. |
long |
nowInMillis() |
protected final MapperService mapperService
protected final ScriptService scriptService
protected final IndexSettings indexSettings
protected final Client client
protected final org.apache.lucene.index.IndexReader reader
protected final java.util.function.LongSupplier nowInMillis
public QueryRewriteContext(IndexSettings indexSettings, MapperService mapperService, ScriptService scriptService, NamedXContentRegistry xContentRegistry, Client client, org.apache.lucene.index.IndexReader reader, java.util.function.LongSupplier nowInMillis)
public Client getClient()
public IndexSettings getIndexSettings()
public MapperService getMapperService()
public org.apache.lucene.index.IndexReader getIndexReader()
IndexReader
, or null
if no index reader is available, for
instance if we are on the coordinating node or if this rewrite context is used to index
queries (percolation).public NamedXContentRegistry getXContentRegistry()
XContentParser
s. Contains registered named parsers needed to parse the query.public QueryParseContext newParseContext(XContentParser parser)
QueryParseContext
that wraps the provided parser.public QueryParseContext newParseContextWithLegacyScriptLanguage(XContentParser parser)
QueryParseContext
like newParseContext(XContentParser)
with the only diffence, that
the default script language will default to what has been set in the 'script.legacy.default_lang' setting.public long nowInMillis()
public BytesReference getTemplateBytes(Script template)