[data.indexPattern][data.search.searchSource] Remove indexPattern.getComputedFields. #85162
Labels
chore
Feature:Data Views
Data Views code and UI - index patterns before 8.0
Feature:Search
Querying infrastructure in Kibana
Icebox
impact:low
Addressing this issue will have a low level of impact on the quality/strength of our product.
loe:small
Small Level of Effort
Team:DataDiscovery
Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL.
technical debt
Improvement of the software architecture and operational architecture
Currently the index pattern class has a
getComputedFields
method which returns docvalue, stored, and scripted fields for a particular pattern. This method is only used by high level search (search source), and in discover.Now that we've added support for the search fields API in search source, this method is less relevant and could probably be removed.
Here's a breakdown of each of the properties it returns and how they could be replaced:
1. docvalue fields
These were only used for ensuring that time fields were all requested in a format that Kibana understands (since ES supports more date formats than Kibana/momentjs knows how to parse). This was previously done using
docvalue_fields
, but since #82383 we are now requesting these formatted fields using the fields API. SogetComputedFields().docvalueFields
is still being used as a convenient way to access these fields, however the naming is confusing as it no longer has anything to do with docvalue fields.Here's the logic that index patterns uses:
This could be moved into a different method or some type of static helper utility which is then used to retrieve all fields of type
date
with formats injected. e.g.2. stored fields
We need to audit whether these are actually needed at all.
getComputedFields
always hardcodes this as['*']
. Search source will either request['*']
or specific field names if the user provides them.My understanding is that the fields API does not return stored fields, but we should test and determine whether we still need this feature at all in search source. Either way I don't think we really need it in
getComputedFields
3. scripted fields
Search source could be switched over to using
indexPattern.getScriptedFields
instead, which is whatgetComputedFields
does internally. There's no reason why we need to usegetComputedFields
for this.cc @timroes @mattkime
The text was updated successfully, but these errors were encountered: