Hi, could use some advice here:
I need to calculate the weighted sums of sets of documents. The weight is based on the fields of the document so I'm using scripts, in a particular a sum aggregation with a script inside filter aggregations. The weights are fixed per call (i.e. all the sum aggregations use the exact same script and pararms).
I have implemented this but I'm not completely satisfied with the solution for 2 reasons:
- The script runs multiple times for the same document (for every filter the document matches).
- I need to pass the parameters for the script multiple times. This param object could get quite big, and I don't want to risk hitting ES max request size.
Anything I could do differently?