Query documents based on sum of nested fields - elasticsearch -
i'm new elastic , i've been trying figure out if possible query documents based on sum or count of nested fields within them. research i've done far it's not, maybe there's way around it?
i know aggregations these output total instead of changing search results based on total.
for example, have set of data looks this:
{ "records": [ { "jhsetzyuof_first": "liam", "jhsetzyuof_last": "mcaneny", "record_activity": [ { "category": "yfv068", "comment": "appeal", "created": "2015-06-14t21:41:22+10:00", "value": 15 } ], "$id": "-jr8g3yemjafavrp1a8i" }, { "jhsetzyuof_first": "pha-hai", "jhsetzyuof_last": "nguyen", "record_activity": [ { "category": "yfv068", "comment": "donated", "created": "2015-06-14t13:49:23+10:00", "value": 10 }, { "category": "yfv068", "comment": "donated", "created": "2015-06-14t13:49:55+10:00", "value": 15 } ], "$id": "-jr8g3y7jqrbtb-cpfst" } ] }
record_activity
mapped nested , can query on it, hoping like:
show sum of record_activity.value > 20
any ideas how achieve through elasticsearch?
Comments
Post a Comment