You can nest aggregations, for example have a terms aggregation that creates a bucket per id (which would then be per user) and then beneath that nest an aggregation that aggregates on the values in the document. Below is an example that gives you the min and max value per user. Is that what you are looking for?
The downside of this is that if you create one bucket per user this might potentially be many buckets but if you only do that for selected users this might be ok. If not then a script field would actually be the better approach I think.
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.