Lucene queries don't support scripted fields at all. You can use the "Add a filter" button below that bar to add a filter on that field. That way we will take care about writing the appropriate scripted filter to Elasticsearch, or you can switch to using KQL in the query bar which would support this (this can either be enabled directly in the bar - if you see an Options link in the right side of the bar) or in the advanced settings in earlier versions.
But using the filter UI will always work no matter if you are using Lucene or KQL.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.