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
Modifier and TypeFieldDescriptionprotected boolean
protected DateMathParser
protected DateFormatter
protected RangeType
-
Constructor Summary
ConstructorDescriptionRangeFieldType(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 DateMathParser
docValueFormat(String format, ZoneId timeZone)
Return aDocValueFormat
that can be used to display and parse values as returned by the fielddata API.fielddataBuilder(String fullyQualifiedIndexName, Supplier<SearchLookup> searchLookup)
Return a fielddata builder for this fieldorg.apache.lucene.search.Query
rangeQuery(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.Query
termQuery(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
boost, collapseType, distanceFeatureQuery, eagerGlobalOrdinals, existsQuery, extractTerm, failIfNoDocValues, failIfNotIndexed, familyTypeName, fuzzyIntervals, fuzzyQuery, getTerms, getTextSearchInfo, hasDocValues, isAggregatable, isFieldWithinQuery, isSearchable, isStored, meta, multiPhraseQuery, name, normalizedWildcardQuery, phrasePrefixQuery, phraseQuery, pointReaderIfPossible, prefixIntervals, prefixQuery, prefixQuery, regexpQuery, setBoost, spanPrefixQuery, termIntervals, termQueryCaseInsensitive, termsQuery, 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
public IndexFieldData.Builder fielddataBuilder(String fullyQualifiedIndexName, Supplier<SearchLookup> searchLookup)Description copied from class:MappedFieldType
Return a fielddata builder for this field- Overrides:
fielddataBuilder
in classMappedFieldType
- Parameters:
fullyQualifiedIndexName
- the name of the index this field-data is build forsearchLookup
- aSearchLookup
supplier to allow for accessing other fields values in the context of runtime fields
-
valueFetcher
Description copied from class:MappedFieldType
Create 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 throw
UnsupportedOperationException
since this could cause a search retrieving multiple fields (like "fields": ["*"]) to fail.- Specified by:
valueFetcher
in classMappedFieldType
-
typeName
Description copied from class:MappedFieldType
Returns the name of this type, as would be specified in mapping properties- Specified by:
typeName
in classMappedFieldType
-
dateTimeFormatter
-
dateMathParser
-
docValueFormat
Description copied from class:MappedFieldType
Return aDocValueFormat
that can be used to display and parse values as returned by the fielddata API. The default implementation returns aDocValueFormat.RAW
.- Overrides:
docValueFormat
in classMappedFieldType
-
termQuery
Description copied from class:MappedFieldType
Generates a query that will only match documents that contain the given value. The default implementation returns aTermQuery
over the value bytes, boosted byMappedFieldType.boost()
.- Specified by:
termQuery
in 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:MappedFieldType
Factory method for range queries.- Overrides:
rangeQuery
in classMappedFieldType
relation
- the relation, nulls should be interpreted like INTERSECTS
-