Hey @Ssingh12,
I believe you've run into a known limitation with scripted fields. Your specific script defines an inline function (compare
), and we recently discovered that this isn't supported when used inside a filter.
See related discussion here: Getting a no_viable_alt_exception only when trying to filter using a scripted field