Hi i wonder how i can extract an array length from painless script?
{
"script": {
"lang": "painless",
"source": "what should be here???) {
"params": {
"plus": ["a","b","c"], //how to retrieve 3 as plus length?
}
}
Hi i wonder how i can extract an array length from painless script?
{
"script": {
"lang": "painless",
"source": "what should be here???) {
"params": {
"plus": ["a","b","c"], //how to retrieve 3 as plus length?
}
}
params
is a HashMap, in which plus
is an ArrayList.
You can get its length by:
"script": {
"lang": "painless",
"inline": "return params.plus.size()",
"params": {
"plus": ["a","b","c"]
}
}