Skip to content

Posibility to exclude specific fields when fetching fields: ['*'] #67751

Closed
@timroes

Description

@timroes

Kibana currently offers a possibility to filter out fields for spcific index patterns:

screenshot-20210120-114420

To make this working with the new fields API (which we query using fields: ['*']) it would be nice to have a way to exclude fields from there, analog to the _source.excludes parameter for _source retrieval.

This API should also support wildcards in the fields names (same as _source.excludes).

Working with nested fields

Once #67432 is merged the fields API has a specific behavior for nested fields. I would expect this exclusion API not to break it, but still return nested JSON, just without the specified exclusion keys.

For clarification a couple of (pseudo examples), given the following document:

{
  name: 'Christoph Büscher',
  addresses: [{ // <-- this is the nested field
     street: 'Fakestreet 123',
     city: 'Berlin'
  }]
}

I would assume the following things being returned from the API given those requests (simplified, and the exclusion API is totally made up):

> fields: *; fields_excluded: ['name']
{
  addresses: [{
     street: 'Fakestreet 123',
     city: 'Berlin'
  }]
}

> fields: *; fields_excluded: ['addresses.city']
{
  name: 'Christoph Büscher',
  addresses: [{
     street: 'Fakestreet 123',
     // Notice how this is stil structured, but the city is now missing
  }]
}

> fields: *; fields_excluded: ['addresses']
{
  name: 'Christoph Büscher'
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Search/SearchSearch-related issues that do not fall into other categories>enhancementTeam:SearchMeta label for search team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions