Module org.elasticsearch.server
Package org.elasticsearch.index.query
Class CoordinatorRewriteContext
java.lang.Object
org.elasticsearch.index.query.QueryRewriteContext
org.elasticsearch.index.query.CoordinatorRewriteContext
Context object used to rewrite
QueryBuilder
instances into simplified version in the coordinator.
Instances of this object rely on information stored in the IndexMetadata
for certain indices.
Right now this context object is able to rewrite range queries that include a known timestamp field
(i.e. the timestamp field for DataStreams) into a MatchNoneQueryBuilder and skip the shards that
don't hold queried data. See IndexMetadata#getTimestampRange() for more details-
Field Summary
Fields inherited from class org.elasticsearch.index.query.QueryRewriteContext
allowedFields, allowExpensiveQueries, allowUnmappedFields, client, fullyQualifiedIndex, indexNameMatcher, indexSettings, mapperService, mappingLookup, mapUnmappedFieldAsString, nowInMillis, runtimeMappings, scriptService, valuesSourceRegistry, writeableRegistry
-
Constructor Summary
ConstructorDescriptionCoordinatorRewriteContext
(XContentParserConfiguration parserConfig, Client client, LongSupplier nowInMillis, IndexLongFieldRange indexLongFieldRange, DateFieldMapper.DateFieldType timestampFieldType) -
Method Summary
Modifier and TypeMethodDescriptionReturns an instance ofCoordinatorRewriteContext
if available or null otherwisegetFieldType
(String fieldName) Returns theMappedFieldType
for the provided field name.Methods inherited from class org.elasticsearch.index.query.QueryRewriteContext
allowExpensiveQueries, convertToDataRewriteContext, convertToIndexMetadataContext, convertToInnerHitsRewriteContext, convertToSearchExecutionContext, executeAsyncActions, fieldType, getAllFields, getFullyQualifiedIndex, getIndexAnalyzers, getIndexSettings, getMappingLookup, getMatchingFieldNames, getParserConfig, getValuesSourceRegistry, getWriteableRegistry, hasAsyncActions, indexMatches, nowInMillis, registerAsyncAction, setAllowUnmappedFields, setMapUnmappedFieldAsString
-
Constructor Details
-
CoordinatorRewriteContext
public CoordinatorRewriteContext(XContentParserConfiguration parserConfig, Client client, LongSupplier nowInMillis, IndexLongFieldRange indexLongFieldRange, DateFieldMapper.DateFieldType timestampFieldType)
-
-
Method Details
-
getFieldType
Description copied from class:QueryRewriteContext
Returns theMappedFieldType
for the provided field name. If the field is not mapped, the behaviour depends on the index.query.parse.allow_unmapped_fields setting, which defaults to true. In case unmapped fields are allowed, null is returned when the field is not mapped. In case unmapped fields are not allowed, either an exception is thrown or the field is automatically mapped as a text field. -
convertToCoordinatorRewriteContext
Description copied from class:QueryRewriteContext
Returns an instance ofCoordinatorRewriteContext
if available or null otherwise- Overrides:
convertToCoordinatorRewriteContext
in classQueryRewriteContext
-