Sub-aggregations: percentiles of sum

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Sub-aggregations: percentiles of sum

Marek Skorek
Hi,

I have a question about subaggregations.

The case is that I have small documents (single opratations) with duration time of this operation which I want to aggregate and finally get the percentile of this sum.

Example:
| operation | time |
| A         | 10   |
| A         | 20   |
| B         | 100  |
| B         | 1000 |
| C         | 10   |
| C         | 10   |


Request:
{
"aggs": {
"by_operation": {
"terms" : { 
"field" : "operation"
},
"aggs" : {
"sum_times" : {
"sum" : { "field" : "time"}
}
}
}
},
"size" : 0
}

Results:
{ ...
"aggregations": {
"by_operation": {
"buckets": [{
"key": "a",
"doc_count": 2,
"sum_times": {
"value": 30.0
}
},
{
"key": "c",
"doc_count": 2,
"sum_times": {
"value": 20.0
}
},
{
"key": "b",
"doc_count": 2,
"sum_times": {
"value": 1100.0
}
}]
}
}
}

After that it will be nice to have i.e. percentile of the field sum_times. I know it can be ordered by the "sum_times" aggregate but it only gives some kind of the biggest/smallest times but not percentiles :(
Question: Is it possible to take that value from another aggreagation? 

Thank you for any answer :-)

Regards,
Marek Skorek.
 

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/c4bc31ad-ca6e-4041-89b2-ae09fb12a2c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Sub-aggregations: percentiles of sum

Adrien Grand-2
Hi,

This is a feature that we are considering but it is unfortunately not available for the moment.


On Tue, Jun 10, 2014 at 11:33 AM, Marek Skorek <[hidden email]> wrote:
Hi,

I have a question about subaggregations.

The case is that I have small documents (single opratations) with duration time of this operation which I want to aggregate and finally get the percentile of this sum.

Example:
| operation | time |
| A         | 10   |
| A         | 20   |
| B         | 100  |
| B         | 1000 |
| C         | 10   |
| C         | 10   |


Request:
{
"aggs": {
"by_operation": {
"terms" : { 
"field" : "operation"
},
"aggs" : {
"sum_times" : {
"sum" : { "field" : "time"}
}
}
}
},
"size" : 0
}

Results:
{ ...
"aggregations": {
"by_operation": {
"buckets": [{
"key": "a",
"doc_count": 2,
"sum_times": {
"value": 30.0
}
},
{
"key": "c",
"doc_count": 2,
"sum_times": {
"value": 20.0
}
},
{
"key": "b",
"doc_count": 2,
"sum_times": {
"value": 1100.0
}
}]
}
}
}

After that it will be nice to have i.e. percentile of the field sum_times. I know it can be ordered by the "sum_times" aggregate but it only gives some kind of the biggest/smallest times but not percentiles :(
Question: Is it possible to take that value from another aggreagation? 

Thank you for any answer :-)

Regards,
Marek Skorek.
 

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/c4bc31ad-ca6e-4041-89b2-ae09fb12a2c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Adrien Grand

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j6XtAu_FazHzfLPxGP1CkWBiy_mC9K4n5aMA8J629sjTA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Sub-aggregations: percentiles of sum

Antonio Augusto Santos
Pretty, pretty, pretty please? ;)
I'd also be interested in something like this, so I can do percentiles based on documents count aggregation, for example, without having to reparse/reindex everything.



On Wednesday, June 11, 2014 12:01:56 PM UTC-3, Adrien Grand wrote:
Hi,

This is a feature that we are considering but it is unfortunately not available for the moment.


On Tue, Jun 10, 2014 at 11:33 AM, Marek Skorek <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="q_hmMB2bkx0J" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">sco...@...> wrote:
Hi,

I have a question about subaggregations.

The case is that I have small documents (single opratations) with duration time of this operation which I want to aggregate and finally get the percentile of this sum.

Example:
| operation | time |
| A         | 10   |
| A         | 20   |
| B         | 100  |
| B         | 1000 |
| C         | 10   |
| C         | 10   |


Request:
{
"aggs": {
"by_operation": {
"terms" : { 
"field" : "operation"
},
"aggs" : {
"sum_times" : {
"sum" : { "field" : "time"}
}
}
}
},
"size" : 0
}

Results:
{ ...
"aggregations": {
"by_operation": {
"buckets": [{
"key": "a",
"doc_count": 2,
"sum_times": {
"value": 30.0
}
},
{
"key": "c",
"doc_count": 2,
"sum_times": {
"value": 20.0
}
},
{
"key": "b",
"doc_count": 2,
"sum_times": {
"value": 1100.0
}
}]
}
}
}

After that it will be nice to have i.e. percentile of the field sum_times. I know it can be ordered by the "sum_times" aggregate but it only gives some kind of the biggest/smallest times but not percentiles :(
Question: Is it possible to take that value from another aggreagation? 

Thank you for any answer :-)

Regards,
Marek Skorek.
 

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="q_hmMB2bkx0J" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">elasticsearc...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/elasticsearch/c4bc31ad-ca6e-4041-89b2-ae09fb12a2c0%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" onmousedown="this.href='https://groups.google.com/d/msgid/elasticsearch/c4bc31ad-ca6e-4041-89b2-ae09fb12a2c0%40googlegroups.com?utm_medium\75email\46utm_source\75footer';return true;" onclick="this.href='https://groups.google.com/d/msgid/elasticsearch/c4bc31ad-ca6e-4041-89b2-ae09fb12a2c0%40googlegroups.com?utm_medium\75email\46utm_source\75footer';return true;">https://groups.google.com/d/msgid/elasticsearch/c4bc31ad-ca6e-4041-89b2-ae09fb12a2c0%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">https://groups.google.com/d/optout.



--
Adrien Grand

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/530cea06-4bed-4fa8-8221-fe10c6d02e1e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Sub-aggregations: percentiles of sum

Marek Skorek
In reply to this post by Marek Skorek
Adrien, 

I am looking forward to this feature and you will manage it quite fast :-)

Again, thank you for an answer. You save my time.



W dniu wtorek, 10 czerwca 2014 11:33:26 UTC+2 użytkownik Marek Skorek napisał:
Hi,

I have a question about subaggregations.

The case is that I have small documents (single opratations) with duration time of this operation which I want to aggregate and finally get the percentile of this sum.

Example:
| operation | time |
| A         | 10   |
| A         | 20   |
| B         | 100  |
| B         | 1000 |
| C         | 10   |
| C         | 10   |


Request:
{
"aggs": {
"by_operation": {
"terms" : { 
"field" : "operation"
},
"aggs" : {
"sum_times" : {
"sum" : { "field" : "time"}
}
}
}
},
"size" : 0
}

Results:
{ ...
"aggregations": {
"by_operation": {
"buckets": [{
"key": "a",
"doc_count": 2,
"sum_times": {
"value": 30.0
}
},
{
"key": "c",
"doc_count": 2,
"sum_times": {
"value": 20.0
}
},
{
"key": "b",
"doc_count": 2,
"sum_times": {
"value": 1100.0
}
}]
}
}
}

After that it will be nice to have i.e. percentile of the field sum_times. I know it can be ordered by the "sum_times" aggregate but it only gives some kind of the biggest/smallest times but not percentiles :(
Question: Is it possible to take that value from another aggreagation? 

Thank you for any answer :-)

Regards,
Marek Skorek.
 

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/a1c47939-810d-4194-90df-6b22bbe45f6e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.