I have a cluster with millions of documents. Each document represents a music transaction.
I want to calculate percentiles with the field price
AND to sum prices by percentiles.
My document looks like
"_source" : {
"commercialModel" : "SubscriptionModel",
"creationDate" : 1529307715833,
"dspCode" : "MUSIC-ONLINE",
"duration" : 78,
"price" : 0.57370562886557345,
"nbTx" : 1,
"releaseTitle" : {
"title" : "Se Cacher Sous L'arbre Sous la Pluie (Hiding Under the Tree in the Rain)",
"title_lower" : "se cacher sous l'arbre sous la pluie (hiding under the tree in the rain)"
},
"releaseType" : "TrackRelease",
}
I can calculate percentiles:
GET /_search
{
"size": 0,
"aggs" : {
"incomes" : {
"percentiles" : {
"field" : "price"
}
}
}
}
But what I need is the sum of the prices per percentile.