Skip to content

Field aliases implementation tracking #31372

@jtibshirani

Description

@jtibshirani

Main issue: #23714
Feature branch: field-aliases
Documentation: https://github.com/elastic/elasticsearch/blob/master/docs/reference/mapping/types/alias.asciidoc

Summary of technical approach:

  • Introduce a new field mapping, with type: alias. This mapping has largely the same structure and handling as a standard field mapping. In the code it corresponds to a new top-level Mapper type called FieldAliasMapper, that does not inherit from FieldMapper.
  • Resolve field aliases used in search and field capabilities APIs to their concrete fields before executing the requests. In general, this resolution occurs as the request is being translated to lucene. At a code level, we make sure to keep track of aliases in MapperService so that when field aliases are supplied to MapperService#fullName, the correct concrete MappedFieldType is returned. This concrete field type is then used in creating queries, fetching doc values, etc. This PR attempts to remove other ways of accessing a field's MappedFieldType that wouldn't handle aliases, as in DocumentFieldMappers#getMapper.

TODO:

Metadata

Metadata

Assignees

Labels

:Search Foundations/MappingIndex mappings, including merging and defining field typesMetaTeam:Search FoundationsMeta label for the Search Foundations team in Elasticsearch

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions