Hello ,
i want to add script filed to calcul members of "DO" ===> ( 1 memberId) and "FO" ===> ( 2 memberId) and return sum --- (3)
i can't get size of doc["model.members"].size() or .length() to make boucle for and sum the result
I just have access to the filed "model.members.memberId"
hi, I tested with doc["model.members"].length and i have this messages :
"script_stack": [
"org.elasticsearch.search.lookup.LeafDocLookup.get(LeafDocLookup.java:77)",
"org.elasticsearch.search.lookup.LeafDocLookup.get(LeafDocLookup.java:36)",
"doc['model.members'].length",
" ^---- HERE"
],
"script": "doc['model.members'].length",
"lang": "painless",
"caused_by": {
"type": "illegal_argument_exception",
"reason": "No field found for [model.members] in mapping with types []"
}
"No field found for [model.members] in mapping with types "
Are you sure that field exists in the index you're trying to query? Maybe some rows don't have the value? Also, the types [] in the message is odd, I don't know if that means it is looking at all types, or no types.
Interesting, I would have thought what you had before would work, I didn't realize you had to reach into the document too. Thanks for following up, it's helpful for other people searching for answers.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.