There can be many documents with the same ASIN fields.
I’m doing teams aggregation, that aggregate documents in my ES cluster based on ASIN field.
This Aggregation counts sum of videoViews and sum of timeWatchedfor each ASIN bucket.
ElasticSearch returns aggregation response where ASIN - a key for each bucket, and sum of timeWatched and sum ofvideoViews are values for this key.
My simple question is how to make aggregation return name and referenceNumber as well? If I know that documents with same ASIN will have same name and referenceNumber?
Set the size to 1, which returns the "first" document. Since all ASIN/name/referenceNumber's correspond to each other, you don't have to worry about sorting. That'll give you the complete document, which you can grab any fields that you want from.
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.