Class TypeFieldMapper.TypeFieldType

java.lang.Object
org.elasticsearch.index.mapper.MappedFieldType
org.elasticsearch.index.mapper.ConstantFieldType
org.elasticsearch.index.mapper.TypeFieldMapper.TypeFieldType
Enclosing class:
TypeFieldMapper

public static final class TypeFieldMapper.TypeFieldType
extends ConstantFieldType
  • Constructor Details

    • TypeFieldType

      public TypeFieldType​(java.lang.String type)
  • Method Details

    • getType

      public java.lang.String getType()
      Returns the name of the current type
    • 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
    • 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
    • existsQuery

      public org.apache.lucene.search.Query existsQuery​(SearchExecutionContext context)
      Overrides:
      existsQuery in class MappedFieldType
    • matches

      protected boolean matches​(java.lang.String pattern, boolean caseInsensitive, SearchExecutionContext context)
      Description copied from class: ConstantFieldType
      Return whether the constant value of this field matches the provided pattern as documented in Regex.simpleMatch(java.lang.String, java.lang.String).
      Specified by:
      matches in class ConstantFieldType
    • 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
    • typeFilter

      public org.apache.lucene.search.Query typeFilter​(java.lang.String[] types)
      Build a type filter This does not emit a deprecation warning, as it is only called when a type has been specified in a REST request and warnings will have already been emitted at the REST layer.