Hi all,
I have a problem, and I don't understand how to solve it, I need your help
I use the Java client API, and I have to use an AggregationBuilders.scriptedMetric with initScript, mapScript and reduceScript. I can run all very well when I use a JSON in my Head plugin, but there is something I can find in Java:
"params": {
"paramRightBasket": [
51,
4206475,
4065960
],
"paramLeftBasket": [
2588950
],
"_agg": {}
}
I don't understand how to initialize the _agg param ?
Map<String, Object> scriptParams = new HashMap<String, Object>();
scriptParams.put("paramLeftBasket", fromIds);
scriptParams.put("paramRightBasket", targetContactId);
scriptParams.put("_agg", >>>> HERE ??? <<<<);
Because in the initscript I must have the following code:
_agg.transactions = [];
Any advice ?
Thanks,
Xavier