Elastic String Length Issue

This works
GET indexname/_search
{
"query": {
"script": {
"script": "doc['fieldName'].value?.length() ==3"
}
}
}

But with < and > operator it does not work
GET indexname/_search
{
"query": {
"script": {
"script": "doc['fieldName'].value?.length() > 3"
}
}
}
fieldName is of String Type.
I am using ElasticSearch 5.3.

Hi,
it'd be helpful if you could tell us more about the problem occurring with the second query.
Also, just to make it sure, the type of fieldName is string or text?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.