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
public static final class RangeFieldMapper.RangeFieldType extends MappedFieldType
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.index.mapper.MappedFieldType
MappedFieldType.Relation -
Field Summary
Fields Modifier and Type Field Description protected booleancoerceprotected DateMathParserdateMathParserprotected DateFormatterdateTimeFormatterprotected RangeTyperangeType -
Constructor Summary
Constructors Constructor Description RangeFieldType(java.lang.String name, boolean indexed, boolean stored, boolean hasDocValues, DateFormatter formatter, boolean coerce, java.util.Map<java.lang.String,java.lang.String> meta)RangeFieldType(java.lang.String name, DateFormatter formatter)RangeFieldType(java.lang.String name, RangeType type)RangeFieldType(java.lang.String name, RangeType type, boolean indexed, boolean stored, boolean hasDocValues, boolean coerce, java.util.Map<java.lang.String,java.lang.String> meta) -
Method Summary
Modifier and Type Method Description protected DateMathParserdateMathParser()DateFormatterdateTimeFormatter()DocValueFormatdocValueFormat(java.lang.String format, java.time.ZoneId timeZone)Return aDocValueFormatthat can be used to display and parse values as returned by the fielddata API.IndexFieldData.BuilderfielddataBuilder(java.lang.String fullyQualifiedIndexName, java.util.function.Supplier<SearchLookup> searchLookup)Return a fielddata builder for this fieldorg.apache.lucene.search.QueryrangeQuery(java.lang.Object lowerTerm, java.lang.Object upperTerm, boolean includeLower, boolean includeUpper, ShapeRelation relation, java.time.ZoneId timeZone, DateMathParser parser, QueryShardContext context)Factory method for range queries.RangeTyperangeType()org.apache.lucene.search.QuerytermQuery(java.lang.Object value, QueryShardContext context)Generates a query that will only match documents that contain the given value.java.lang.StringtypeName()Returns the name of this type, as would be specified in mapping propertiesValueFetchervalueFetcher(MapperService mapperService, SearchLookup searchLookup, java.lang.String format)Create a helper class to fetch field values during theFetchFieldsPhase.Methods inherited from class org.elasticsearch.index.mapper.MappedFieldType
boost, distanceFeatureQuery, eagerGlobalOrdinals, existsQuery, extractTerm, failIfNoDocValues, failIfNotIndexed, familyTypeName, fuzzyQuery, getTextSearchInfo, hasDocValues, indexAnalyzer, intervals, isAggregatable, isFieldWithinQuery, isSearchable, isStored, meta, multiPhraseQuery, name, phrasePrefixQuery, phraseQuery, pointReaderIfPossible, prefixQuery, prefixQuery, regexpQuery, setBoost, setEagerGlobalOrdinals, setIndexAnalyzer, spanPrefixQuery, termQueryCaseInsensitive, termsQuery, valueForDisplay, wildcardQuery, wildcardQuery
-
Field Details
-
rangeType
-
dateTimeFormatter
-
dateMathParser
-
coerce
protected final boolean coerce
-
-
Constructor Details
-
RangeFieldType
public RangeFieldType(java.lang.String name, RangeType type, boolean indexed, boolean stored, boolean hasDocValues, boolean coerce, java.util.Map<java.lang.String,java.lang.String> meta) -
RangeFieldType
-
RangeFieldType
public RangeFieldType(java.lang.String name, boolean indexed, boolean stored, boolean hasDocValues, DateFormatter formatter, boolean coerce, java.util.Map<java.lang.String,java.lang.String> meta) -
RangeFieldType
-
-
Method Details
-
rangeType
-
fielddataBuilder
public IndexFieldData.Builder fielddataBuilder(java.lang.String fullyQualifiedIndexName, java.util.function.Supplier<SearchLookup> searchLookup)Description copied from class:MappedFieldTypeReturn a fielddata builder for this field- Overrides:
fielddataBuilderin classMappedFieldType- Parameters:
fullyQualifiedIndexName- the name of the index this field-data is build forsearchLookup- aSearchLookupsupplier to allow for accessing other fields values in the context of runtime fields
-
valueFetcher
public ValueFetcher valueFetcher(MapperService mapperService, SearchLookup searchLookup, java.lang.String format)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
public java.lang.String 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:MappedFieldTypeReturn aDocValueFormatthat can be used to display and parse values as returned by the fielddata API. The default implementation returns aDocValueFormat.RAW.- 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, boosted byMappedFieldType.boost().- Specified by:
termQueryin classMappedFieldType
-
rangeQuery
public org.apache.lucene.search.Query rangeQuery(java.lang.Object lowerTerm, java.lang.Object upperTerm, boolean includeLower, boolean includeUpper, ShapeRelation relation, java.time.ZoneId timeZone, DateMathParser parser, QueryShardContext context)Description copied from class:MappedFieldTypeFactory method for range queries.- Overrides:
rangeQueryin classMappedFieldTyperelation- the relation, nulls should be interpreted like INTERSECTS
-