elpaisa
(John Diaz)
February 27, 2018, 4:51pm
1
Hi, I have a nested field with two properties:
{
"rating": 2
"victim": [{
"ip": "...",
"instanceId": "....""
}]
}
I want to aggregate over the rating and get the IP or InstanceId for each document, not both in the bucket list.
Thanks.
elpaisa
(John Diaz)
February 28, 2018, 2:29pm
2
After a lot of searching i found the way via painless:
"terms" : {
"script" : {
"source": "doc['victim.instanceId'].value == null ? doc['victim.ip'] : doc['victim.instanceId']",
"lang": "painless"
},
"missing": "N/A"
}
system
(system)
Closed
March 28, 2018, 2:29pm
3
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.