Class FieldAliasMapper

java.lang.Object
org.elasticsearch.index.mapper.Mapper
org.elasticsearch.index.mapper.FieldAliasMapper
All Implemented Interfaces:
Iterable<Mapper>, ToXContent, ToXContentFragment

public final class FieldAliasMapper extends Mapper
A mapper for field aliases. A field alias has no concrete field mappings of its own, but instead points to another field by its path. Once defined, an alias can be used in place of the concrete field name in search requests.
  • Field Details

  • Constructor Details

    • FieldAliasMapper

      public FieldAliasMapper(String simpleName, String name, String path)
  • Method Details

    • name

      public String name()
      Description copied from class: Mapper
      Returns the canonical name which uniquely identifies the mapper against other mappers in a type.
      Specified by:
      name in class Mapper
    • typeName

      public String typeName()
      Description copied from class: Mapper
      Returns a name representing the type of this mapper.
      Specified by:
      typeName in class Mapper
    • path

      public String path()
    • merge

      public Mapper merge(Mapper mergeWith)
      Description copied from class: Mapper
      Return the merge of mergeWith into this. Both this and mergeWith will be left unmodified.
      Specified by:
      merge in class Mapper
    • iterator

      public Iterator<Mapper> iterator()
    • toXContent

      public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
      Throws:
      IOException
    • validate

      public void validate(MappingLookup mappers)
      Description copied from class: Mapper
      Validate any cross-field references made by this mapper
      Specified by:
      validate in class Mapper
      Parameters:
      mappers - a MappingLookup that can produce references to other mappers