Module org.elasticsearch.server
Package org.elasticsearch.index.mapper
Class RangeFieldMapper.RangeFieldType
java.lang.Object
org.elasticsearch.index.mapper.MappedFieldType
org.elasticsearch.index.mapper.RangeFieldMapper.RangeFieldType
- Enclosing class:
- RangeFieldMapper
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.index.mapper.MappedFieldType
MappedFieldType.CollapseType, MappedFieldType.Relation -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final booleanprotected final DateMathParserprotected final DateFormatterprotected final RangeType -
Constructor Summary
ConstructorsConstructorDescriptionRangeFieldType(String name, boolean indexed, boolean stored, boolean hasDocValues, DateFormatter formatter, boolean coerce, Map<String, String> meta) RangeFieldType(String name, DateFormatter formatter) RangeFieldType(String name, RangeType type) RangeFieldType(String name, RangeType type, boolean indexed, boolean stored, boolean hasDocValues, boolean coerce, Map<String, String> meta) -
Method Summary
Modifier and TypeMethodDescriptionprotected DateMathParserdocValueFormat(String format, ZoneId timeZone) Pick aDocValueFormatthat can be used to display and parse values of fields of this type.fielddataBuilder(FieldDataContext fieldDataContext) Return a fielddata builder for this fieldbooleanmayExistInIndex(SearchExecutionContext context) org.apache.lucene.search.QueryrangeQuery(Object lowerTerm, Object upperTerm, boolean includeLower, boolean includeUpper, ShapeRelation relation, ZoneId timeZone, DateMathParser parser, SearchExecutionContext context) Factory method for range queries.org.apache.lucene.search.QuerytermQuery(Object value, SearchExecutionContext context) Generates a query that will only match documents that contain the given value.typeName()Returns the name of this type, as would be specified in mapping propertiesvalueFetcher(SearchExecutionContext context, String format) Create a helper class to fetch field values during theFetchFieldsPhase.Methods inherited from class org.elasticsearch.index.mapper.MappedFieldType
checkNoFormat, checkNoTimeZone, collapseType, distanceFeatureQuery, eagerGlobalOrdinals, existsQuery, extractTerm, failIfNoDocValues, failIfNotIndexed, failIfNotIndexedNorDocValuesFallback, familyTypeName, fuzzyIntervals, fuzzyQuery, getMetricType, getTerms, getTextSearchInfo, hasDocValues, isAggregatable, isDimension, isFieldWithinQuery, isIndexed, isSearchable, isStored, meta, multiPhraseQuery, name, normalizedWildcardQuery, phrasePrefixQuery, phraseQuery, pointReaderIfPossible, prefixIntervals, prefixQuery, prefixQuery, regexpQuery, spanPrefixQuery, termIntervals, termQueryCaseInsensitive, termsQuery, validateMatchedRoutingPath, valueForDisplay, wildcardIntervals, wildcardQuery, wildcardQuery
-
Field Details
-
rangeType
-
dateTimeFormatter
-
dateMathParser
-
coerce
protected final boolean coerce
-
-
Constructor Details
-
RangeFieldType
-
RangeFieldType
-
RangeFieldType
public RangeFieldType(String name, boolean indexed, boolean stored, boolean hasDocValues, DateFormatter formatter, boolean coerce, Map<String, String> meta) -
RangeFieldType
-
-
Method Details
-
rangeType
-
fielddataBuilder
Description copied from class:MappedFieldTypeReturn a fielddata builder for this field- Overrides:
fielddataBuilderin classMappedFieldType- Parameters:
fieldDataContext- the context for the fielddata
-
mayExistInIndex
- Overrides:
mayExistInIndexin classMappedFieldType- Returns:
- if the field may have values in the underlying index
Note that this should only return
falseif it is not possible for it to match on a term query. - See Also:
-
valueFetcher
Description copied from class:MappedFieldTypeCreate a helper class to fetch field values during theFetchFieldsPhase. New field types must implement this method in order to support the search 'fields' option. Except for metadata fields, field types should not throwUnsupportedOperationExceptionsince this could cause a search retrieving multiple fields (like "fields": ["*"]) to fail.- Specified by:
valueFetcherin classMappedFieldType
-
typeName
Description copied from class:MappedFieldTypeReturns the name of this type, as would be specified in mapping properties- Specified by:
typeNamein classMappedFieldType
-
dateTimeFormatter
-
dateMathParser
-
docValueFormat
Description copied from class:MappedFieldTypePick aDocValueFormatthat can be used to display and parse values of fields of this type.- Overrides:
docValueFormatin classMappedFieldType
-
termQuery
Description copied from class:MappedFieldTypeGenerates a query that will only match documents that contain the given value. The default implementation returns aTermQueryover the value bytes- Specified by:
termQueryin classMappedFieldType
-
rangeQuery
public org.apache.lucene.search.Query rangeQuery(Object lowerTerm, Object upperTerm, boolean includeLower, boolean includeUpper, ShapeRelation relation, ZoneId timeZone, DateMathParser parser, SearchExecutionContext context) Description copied from class:MappedFieldTypeFactory method for range queries.- Overrides:
rangeQueryin classMappedFieldTyperelation- the relation, nulls should be interpreted like INTERSECTS
-