Skip to content

Reimplement field aliases as runtime fields #87969

@javanna

Description

@javanna

Support for field aliases was added before runtime fields existed. Field aliases are mapped under properties, can only point to a field mapped under properties, and cannot be modified/removed. Also, field aliases don't play well with multi_fields.

Via runtime field, it is already possible to manually create a field alias: create a runtime field with a small script that returns the value of the field that needs to be aliased. This is much more flexible than declaring a field alias as it solves the two issues above: it can be removed (see #36418), and it can point to any field (runtime as well as indexed). Additionally, it can be declared in the search request. While this is already possible, it is too manual and we would rather like to streamline the notion of alias as part of the runtime section, without requiring to specify an alias.

There are some backwards compatibility concerns in case we want to go ahead and remove field aliases defined under properties, that could probably be dealt with separately. Ideally, we add support for aliases to the runtime section and the existing field aliases can shortcut to the new implementation?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions