elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.7k stars 8.12k forks source link

[DataViews] Create a utility to create a new ES|QL type field #182646

Open stratoula opened 4 months ago

stratoula commented 4 months ago

Describe the feature:

There are many occurences in the code where we are creating a new ES|QL field like:

new DataViewField({
        name: columnName,
        type,
        esTypes,
        searchable: true,
        aggregatable: false,
      });

It will be great to create a utility and change this everywhere we are using it.

elasticmachine commented 4 months ago

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

elasticmachine commented 4 months ago

Pinging @elastic/kibana-esql (Team:ESQL)

stratoula commented 4 months ago

This is a recommendation from @jughosta. I see we are using this class multiple times in the code for both dataview and text based fields. We don't have extra utilities for the dataview mode nor the text based mode.

Creating an ES|QL field doesnt add special properties atm so I am not sure how important this is. Unless we want to do something different here that I am missing.

Anyway I will leave this to the @elastic/kibana-data-discovery team to evaluate.