-
Notifications
You must be signed in to change notification settings - Fork 919
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] is filter not working with numeric Scripted fields #6996
Comments
Was able to reproduce this bug. When we add a filter by clicking on one of the bar on the visualization, it will send the query value as number type, The above flows are true for both numeric scripted field, and any numeric fields. However, when we send a query containing a value of string type for other numeric fields, ex. for opensearch_dashboards_sample_data_ecommerce, when we add filter like |
When we create a scripted field, if we set the type as number, add filter will not work since the filter bar treats the input as a string. However, if we created the same scripted field as a string type, add filter will work correctly. So add filter will not work for So i think we should probably modify the filter bar to solve this issue? Like after user choose the field, and if the field is numeric type, the value input textbox should convert the string into a number so scripted field can work properly? @kavilla @AMoo-Miki |
For boolean scripted field, the filter bar detects the type as boolean, and it populates boolean values to send, so the filter bar is working properly for boolean scripted field. Screen.Recording.2024-06-11.at.3.45.20.PM.mov |
Describe the bug
Adding filters for scripted numeric fields using
is
operator after clicking the Add Filter Button does not produce any result. However directly clicking on a visualization containing the required field adds the filter correctly. This behavior is observed across visualizations. (Tested the behavior in VisBuilder & Vertical bar Visualization)Payload sent while using the Add Filter button
PayloadAddFilter.json
Payload being sent while clicking on the visualization directly
PayloadVisualization.json
Upon analysis of Payloads, the following observation was found.
When using the Add Filter button, The value is being sent as string.
"value": "66"
While when we are using the visualization to filter it sends the
"value": 66
This explains why we are not getting the expected results with the Add Filter option in case of numeric fields since we are sending the value as string.
Expected behavior
Add Filter should work with scripted numeric fields while using the is operator.
OpenSearch Version
3.0.0-snapshot
Dashboards Version
3.0.0
Plugins
Please list all plugins currently enabled.
Screenshots
Using the Add filter
Clicking on the Visualization
Host/Environment (please complete the following information):
OS: [e.g. iOS]
Browser and version [e.g. 22]
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: