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
  • Field Details

    • rangeType

      protected final RangeType rangeType
    • dateTimeFormatter

      protected final DateFormatter dateTimeFormatter
    • dateMathParser

      protected final DateMathParser 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

      public RangeFieldType​(java.lang.String name, RangeType type)
    • 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

      public RangeFieldType​(java.lang.String name, DateFormatter formatter)
  • Method Details

    • rangeType

      public RangeType rangeType()
    • fielddataBuilder

      public IndexFieldData.Builder fielddataBuilder​(java.lang.String fullyQualifiedIndexName, java.util.function.Supplier<SearchLookup> searchLookup)
      Description copied from class: MappedFieldType
      Return a fielddata builder for this field
      Overrides:
      fielddataBuilder in class MappedFieldType
      Parameters:
      fullyQualifiedIndexName - the name of the index this field-data is build for
      searchLookup - a SearchLookup supplier to allow for accessing other fields values in the context of runtime fields
    • valueFetcher

      public ValueFetcher valueFetcher​(SearchExecutionContext context, java.lang.String format)
      Description copied from class: MappedFieldType
      Create a helper class to fetch field values during the FetchFieldsPhase.

      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 class MappedFieldType
    • typeName

      public java.lang.String typeName()
      Description copied from class: MappedFieldType
      Returns the name of this type, as would be specified in mapping properties
      Specified by:
      typeName in class MappedFieldType
    • dateTimeFormatter

      public DateFormatter dateTimeFormatter()
    • dateMathParser

      protected DateMathParser dateMathParser()
    • docValueFormat

      public DocValueFormat docValueFormat​(java.lang.String format, java.time.ZoneId timeZone)
      Description copied from class: MappedFieldType
      Return a DocValueFormat that can be used to display and parse values as returned by the fielddata API. The default implementation returns a DocValueFormat.RAW.
      Overrides:
      docValueFormat in class MappedFieldType
    • termQuery

      public org.apache.lucene.search.Query termQuery​(java.lang.Object value, SearchExecutionContext context)
      Description copied from class: MappedFieldType
      Generates a query that will only match documents that contain the given value. The default implementation returns a TermQuery over the value bytes, boosted by MappedFieldType.boost().
      Specified by:
      termQuery in class MappedFieldType
    • 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, SearchExecutionContext context)
      Description copied from class: MappedFieldType
      Factory method for range queries.
      Overrides:
      rangeQuery in class MappedFieldType
      relation - the relation, nulls should be interpreted like INTERSECTS