When I run the following script to retrieve the lists in size order
GET indexname/_search
{
"sort" : {
"_script" : {
"script" : "_source.list.size()",
"type" : "string",
"order" : "desc"
}
}
}
The script is using ASCII sort order on the results from size()
So 9 is first or 99
then 8 or 888
Then 7 or 7777
I need to cast the return to integer somehow or tell the script to use integer?