I'm locked in a trap with Elastic, trying to sort hits by the size of a sub-property (array).
I applied the following body query :
'{
"query": {
"match_all": {}
},
"sort": {
"_script": {
"type": "number",
"script": "doc[\"myarray\"].values.size()",
"order": "desc"
}
}
}'
However as Elastic Array type isn't in the mapping (support out of the box) i have an error telling me that my array isn't the mapping (normal...)
Any idea ?
Thanks !