-
Notifications
You must be signed in to change notification settings - Fork 84
[BUG] Saved search filter types are not fully supported when creating csv report #92
Description
Missing the following filters
- range => Fixed in Support range filters for csv reports #185
- geo -> no need to fix, as it's not able to add filters on geo fields
- query_string => [BUG] Support filter type "query_string" on saved search #207
Some filters will not be recognized and parsed by csv reporting module and couldn't generate correct report, with filtered data.
e.g. range filter
- a example meta filter field of a saved search
"filter":[{"meta":{"params":{"gte":3,"lt":5},"alias":null,"negate":false,"disabled":false,"type":"range","key":"total_quantity","indexRefName":"kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index"},"range":{"total_quantity":{"gte":3,"lt":5}},"$state":{"store":"appState"}}
-
After looking into the code which parse the saved search meta, I found only certain type is parsed.
https://github.com/opensearch-project/dashboards-reports/blob/d08711e2f1dad573716d5aeacd5247d09b2a8af9/dashboards-reports/server/routes/utils/dataReportHelpers.ts#L69-L82 -
if comparing with all the availiable types, we are missing some.
https://github.com/opensearch-project/OpenSearch-Dashboards/blob/4874000ffba2dd6d25948e3efd30cfd914f52986/src/legacy/core_plugins/data/public/filter/filter_bar/filter_editor/lib/get_filter_display_text.tsx#L43-L50
To Reproduce
Steps to reproduce the behavior:
- add sample e-commerce dataset
- go to Discover page and add a filter of "total_quantity" is between "3" to "5"
- save it
- create csv report
Expected behavior
Plugins
Reporting
Screenshots
If applicable, add screenshots to help explain your problem.
Host/Environment (please complete the following information):
- OS: [e.g. iOS]
- Version [e.g. 22]
Additional context
Add any other context about the problem here.