-
Notifications
You must be signed in to change notification settings - Fork 84
CSV reports missing metadata fields even when selected #202
Copy link
Copy link
Closed
Labels
Description
ref: metaData fields
When user selected metadata fields like "_index", "_type" in Discover, it will not appear in csv reports, without throwing any error.
Root cause
let result = traverse(data._source, report._source.selectedFields)
The traverse logic aims to find the data fields by matching the selected fields. Selected metaData fields will be saved in selected fields, this part is fine. The issue is with the data._source
The following is an example of the data object, and you can see metadata fields are in the data object, but the data._source field we passed to traverse()for matching will not include the metaData fields anyways.
{
"_index": "opensearch_dashboards_sample_data_ecommerce",
"_type": "_doc",
"_id": "j89pyHwBt6Wu9HvV9AcN",
"_version": 1,
"_score": null,
"_source": {
"category": [
"Women's Clothing"
]
},
"fields": {
"order_date": [
"2021-10-28T19:27:50.000"
],
"products.created_on": [
"2016-12-15T19:27:50.000",
"2016-12-15T19:27:50.000"
]
},
"sort": [
1635449270000
]
}
Reactions are currently unavailable