public class QueryRewriteContext extends java.lang.Object implements ParseFieldMatcherSupplier
QueryBuilder
instances into simplified version.Modifier and Type | Field and Description |
---|---|
protected Client |
client |
protected ClusterState |
clusterState |
protected IndexSettings |
indexSettings |
protected IndicesQueriesRegistry |
indicesQueriesRegistry |
protected MapperService |
mapperService |
protected org.apache.lucene.index.IndexReader |
reader |
protected ScriptService |
scriptService |
Constructor and Description |
---|
QueryRewriteContext(IndexSettings indexSettings,
MapperService mapperService,
ScriptService scriptService,
IndicesQueriesRegistry indicesQueriesRegistry,
Client client,
org.apache.lucene.index.IndexReader reader,
ClusterState clusterState) |
Modifier and Type | Method and Description |
---|---|
Client |
getClient()
Returns a clients to fetch resources from local or remove nodes.
|
ClusterState |
getClusterState()
Returns the cluster state as is when the operation started.
|
org.apache.lucene.index.IndexReader |
getIndexReader()
Return the current
IndexReader , or null if we are on the coordinating node. |
IndexSettings |
getIndexSettings()
Returns the index settings for this context.
|
MapperService |
getMapperService()
Return the MapperService.
|
ParseFieldMatcher |
getParseFieldMatcher() |
BytesReference |
getTemplateBytes(Script template) |
QueryParseContext |
newParseContext(XContentParser parser)
Returns a new
QueryParseContext that wraps the provided parser, using the ParseFieldMatcher settings that
are configured in the index settings. |
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. |
protected final MapperService mapperService
protected final ScriptService scriptService
protected final IndexSettings indexSettings
protected final IndicesQueriesRegistry indicesQueriesRegistry
protected final Client client
protected final org.apache.lucene.index.IndexReader reader
protected final ClusterState clusterState
public QueryRewriteContext(IndexSettings indexSettings, MapperService mapperService, ScriptService scriptService, IndicesQueriesRegistry indicesQueriesRegistry, Client client, org.apache.lucene.index.IndexReader reader, ClusterState clusterState)
public Client getClient()
public final IndexSettings getIndexSettings()
public final MapperService getMapperService()
public org.apache.lucene.index.IndexReader getIndexReader()
IndexReader
, or null
if we are on the coordinating node.public ParseFieldMatcher getParseFieldMatcher()
getParseFieldMatcher
in interface ParseFieldMatcherSupplier
public ClusterState getClusterState()
public QueryParseContext newParseContext(XContentParser parser)
QueryParseContext
that wraps the provided parser, using the ParseFieldMatcher settings that
are configured in the index settings. The default script language will always default to Painless.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 BytesReference getTemplateBytes(Script template)