Alias field type

    copy

    Parameters

    Alias fields must obey the following rules:

    • An alias field can only have one original field.
    • In nested objects, the alias must have the same nesting level as the original field.

    To change the field that the alias references, update the mappings. Note that aliases in any previously stored percolator queries will still reference the original field.

    Original field

    • The original field must be created before the alias is created.
    • The original field cannot be an object or another alias.

    You can use aliases in the following read operations of the search API:

    • Queries
    • Sorts
    • Aggregations
    • docvalue_fields
    • Suggestions
    • Highlights
    • Scripts that access field values

    Using aliases in field capabilities API operations

    To use an alias in the field capabilities API, specify it in the fields parameter.

    copy

    • In write requests, such as update requests.
    • In multi-fields or as a target of .
    • As a _source parameter for filtering results.
    • In terms, , and geo_shape queries (aliases are not supported when retrieving documents).

    Wildcards

    In search and field capabilities wildcard queries, both the original field and the alias are matched against the wildcard pattern.

    copy