Scripted field when added as filter for value 0 shows the full script

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
Opensearch 3.x

Describe the issue:
If the filter is applied using a scripted field and if any comparison is done against 0 then the whole script is shown in the filter bar. Other than 0 it is shown properly

This was not happening in 2.x

Please find the screenshots attached.

Relevant Logs or Screenshots:
sample data of flights and hour_of_day is the scripted field in the index

For the value 0:

For value other than 0:

Please let us know if this is a bug or is it working correctly.

Thanks in advance

@tejashu Did you test this with latest 3.6.0 version? Also which 2.x version are you referring to?

I tested with 3.5.0
Referring to 2.11 in 2.x version

Is it resolved in 3.6.0?

@tejashu I did some testing with different 2.x and 3.x versions. The issue appeared in 2.16.0 and is still in the latest 3.6.0. As you’ve reported the scripted field filtering only with value 0 is causing that.

I would suggest opening a GitHub issue in the OpenSearch Dashboards repo. If you do so, please share the link here.

Raised the issue in GitHub!