Is there any way to get the total number of buckets a aggs generated?

we do a aggregation, and we only want to get the number of buckets it
generated, is there any way to archive this goal ?

Thanks

--
不学习,不知道

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CA%2BJstLCU7Pj3YF2Oy2SXH%2Brc4kxMMY87dRxoqes_wgAUvs8chg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

To some degree, I can archive this goal by setting size: 0 in the terms
aggs to list all the generated buckets, but it really consumes much memory,
so is there any internal API to do this job ?

Thanks.

2014-09-02 9:38 GMT+08:00 panfei cnweike@gmail.com:

we do a aggregation, and we only want to get the number of buckets it
generated, is there any way to archive this goal ?

Thanks

--
不学习,不知道

--
不学习,不知道

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CA%2BJstLD6PPAaYyc19rsdy4pO0MbpxJBYbpBqoteZ%3DMQN3diKcg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Hello ,

Setting search_type to count avoids executing the fetch phase of the search
making the request more efficient. See Search Type
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-search-type.html
for more information on the search_type parameter.

Thanks
Vineeth

On Tue, Sep 2, 2014 at 7:26 AM, panfei cnweike@gmail.com wrote:

To some degree, I can archive this goal by setting size: 0 in the terms
aggs to list all the generated buckets, but it really consumes much memory,
so is there any internal API to do this job ?

Thanks.

2014-09-02 9:38 GMT+08:00 panfei cnweike@gmail.com:

we do a aggregation, and we only want to get the number of buckets it

generated, is there any way to archive this goal ?

Thanks

--
不学习,不知道

--
不学习,不知道

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CA%2BJstLD6PPAaYyc19rsdy4pO0MbpxJBYbpBqoteZ%3DMQN3diKcg%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CA%2BJstLD6PPAaYyc19rsdy4pO0MbpxJBYbpBqoteZ%3DMQN3diKcg%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAGdPd5%3DFLQQVJHMj0AzNr4%3DL3G5vv3h%3DR9FzXY-5k8CEoeorXg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Hi vineeth, thanks for the tips, but I really want to know the number of
the buckets generated by the aggs. a bucket_count's value (like the
doc_count's value) in the response.

2014-09-02 10:00 GMT+08:00 vineeth mohan vm.vineethmohan@gmail.com:

Hello ,

Setting search_type to count avoids executing the fetch phase of the
search making the request more efficient. See Search Type
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-search-type.html
for more information on the search_type parameter.

Thanks
Vineeth

On Tue, Sep 2, 2014 at 7:26 AM, panfei cnweike@gmail.com wrote:

To some degree, I can archive this goal by setting size: 0 in the terms
aggs to list all the generated buckets, but it really consumes much memory,
so is there any internal API to do this job ?

Thanks.

2014-09-02 9:38 GMT+08:00 panfei cnweike@gmail.com:

we do a aggregation, and we only want to get the number of buckets it

generated, is there any way to archive this goal ?

Thanks

--
不学习,不知道

--
不学习,不知道

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CA%2BJstLD6PPAaYyc19rsdy4pO0MbpxJBYbpBqoteZ%3DMQN3diKcg%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CA%2BJstLD6PPAaYyc19rsdy4pO0MbpxJBYbpBqoteZ%3DMQN3diKcg%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAGdPd5%3DFLQQVJHMj0AzNr4%3DL3G5vv3h%3DR9FzXY-5k8CEoeorXg%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAGdPd5%3DFLQQVJHMj0AzNr4%3DL3G5vv3h%3DR9FzXY-5k8CEoeorXg%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
不学习,不知道

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CA%2BJstLDwhNFgLaECiiW5siF08o%3DaMmpAL05Xbu3n2F%2BrB%3DibRg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Hello ,

Couple of options here.
Add the count aggregation -

{
"aggregations": {
"aggs": {
"value_count": {
"field": "names"
}
}
}
}

Or , set the size as 0 for the aggregation , it will return all the buckets

This might not be a good idea in case the number of buckets are too large.

But again , the number of buckets seems to be a basic requirement and i
feel there should be some other better way to do it.
I will file an issue , if i dont find one.

Thanks
Vineeth

On Tue, Sep 2, 2014 at 8:13 AM, panfei cnweike@gmail.com wrote:

Hi vineeth, thanks for the tips, but I really want to know the number of
the buckets generated by the aggs. a bucket_count's value (like the
doc_count's value) in the response.

2014-09-02 10:00 GMT+08:00 vineeth mohan vm.vineethmohan@gmail.com:

Hello ,

Setting search_type to count avoids executing the fetch phase of the
search making the request more efficient. See Search Type
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-search-type.html
for more information on the search_type parameter.

Thanks
Vineeth

On Tue, Sep 2, 2014 at 7:26 AM, panfei cnweike@gmail.com wrote:

To some degree, I can archive this goal by setting size: 0 in the terms
aggs to list all the generated buckets, but it really consumes much memory,
so is there any internal API to do this job ?

Thanks.

2014-09-02 9:38 GMT+08:00 panfei cnweike@gmail.com:

we do a aggregation, and we only want to get the number of buckets it

generated, is there any way to archive this goal ?

Thanks

--
不学习,不知道

--
不学习,不知道

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CA%2BJstLD6PPAaYyc19rsdy4pO0MbpxJBYbpBqoteZ%3DMQN3diKcg%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CA%2BJstLD6PPAaYyc19rsdy4pO0MbpxJBYbpBqoteZ%3DMQN3diKcg%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAGdPd5%3DFLQQVJHMj0AzNr4%3DL3G5vv3h%3DR9FzXY-5k8CEoeorXg%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAGdPd5%3DFLQQVJHMj0AzNr4%3DL3G5vv3h%3DR9FzXY-5k8CEoeorXg%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
不学习,不知道

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CA%2BJstLDwhNFgLaECiiW5siF08o%3DaMmpAL05Xbu3n2F%2BrB%3DibRg%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CA%2BJstLDwhNFgLaECiiW5siF08o%3DaMmpAL05Xbu3n2F%2BrB%3DibRg%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAGdPd5kV9Qi%3D4UWY4HG0E4b9mefT8NnUpUWJ7GgfgjEJBcXbhg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Though this is not the solution, thanks for your advice.

2014-09-02 11:31 GMT+08:00 vineeth mohan vm.vineethmohan@gmail.com:

Hello ,

Couple of options here.
Add the count aggregation -
Elasticsearch Platform — Find real-time answers at scale | Elastic

{
"aggregations": {
"aggs": {
"value_count": {
"field": "names"
}
}
}
}

Or , set the size as 0 for the aggregation , it will return all the
buckets -
Show all Elasticsearch aggregation results/buckets and not just 10 - Stack Overflow
This might not be a good idea in case the number of buckets are too large.

But again , the number of buckets seems to be a basic requirement and i
feel there should be some other better way to do it.
I will file an issue , if i dont find one.

Thanks
Vineeth

On Tue, Sep 2, 2014 at 8:13 AM, panfei cnweike@gmail.com wrote:

Hi vineeth, thanks for the tips, but I really want to know the number of
the buckets generated by the aggs. a bucket_count's value (like the
doc_count's value) in the response.

2014-09-02 10:00 GMT+08:00 vineeth mohan vm.vineethmohan@gmail.com:

Hello ,

Setting search_type to count avoids executing the fetch phase of the
search making the request more efficient. See Search Type
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-search-type.html
for more information on the search_type parameter.

Thanks
Vineeth

On Tue, Sep 2, 2014 at 7:26 AM, panfei cnweike@gmail.com wrote:

To some degree, I can archive this goal by setting size: 0 in the terms
aggs to list all the generated buckets, but it really consumes much memory,
so is there any internal API to do this job ?

Thanks.

2014-09-02 9:38 GMT+08:00 panfei cnweike@gmail.com:

we do a aggregation, and we only want to get the number of buckets it

generated, is there any way to archive this goal ?

Thanks

--
不学习,不知道

--
不学习,不知道

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CA%2BJstLD6PPAaYyc19rsdy4pO0MbpxJBYbpBqoteZ%3DMQN3diKcg%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CA%2BJstLD6PPAaYyc19rsdy4pO0MbpxJBYbpBqoteZ%3DMQN3diKcg%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAGdPd5%3DFLQQVJHMj0AzNr4%3DL3G5vv3h%3DR9FzXY-5k8CEoeorXg%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAGdPd5%3DFLQQVJHMj0AzNr4%3DL3G5vv3h%3DR9FzXY-5k8CEoeorXg%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
不学习,不知道

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CA%2BJstLDwhNFgLaECiiW5siF08o%3DaMmpAL05Xbu3n2F%2BrB%3DibRg%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CA%2BJstLDwhNFgLaECiiW5siF08o%3DaMmpAL05Xbu3n2F%2BrB%3DibRg%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAGdPd5kV9Qi%3D4UWY4HG0E4b9mefT8NnUpUWJ7GgfgjEJBcXbhg%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAGdPd5kV9Qi%3D4UWY4HG0E4b9mefT8NnUpUWJ7GgfgjEJBcXbhg%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
不学习,不知道

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CA%2BJstLB1Bz0r_CGv6NTBL_Vm7UC%3Dqqnr5y3dBgffuHVmpC-ZsQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

I tend to agree that knowing the total # of buckets would be universally
useful.

Even though you may only want to "show" 10 buckets to the user, you may
also want to show that there are "15 more..." - and then allow the user to
expand on that to see all 25.

On Tuesday, 2 September 2014 04:31:23 UTC+1, vineeth mohan wrote:

But again , the number of buckets seems to be a basic requirement and i
feel there should be some other better way to do it.
I will file an issue , if i dont find one.

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/9b6da6cd-c960-4293-9182-0150eaa4057e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

I think this is something the cardinality[1] aggregation can be used for?

[1]

On Thu, Sep 4, 2014 at 7:46 PM, mooky nick.minutello@gmail.com wrote:

I tend to agree that knowing the total # of buckets would be universally
useful.

Even though you may only want to "show" 10 buckets to the user, you may
also want to show that there are "15 more..." - and then allow the user to
expand on that to see all 25.

On Tuesday, 2 September 2014 04:31:23 UTC+1, vineeth mohan wrote:

But again , the number of buckets seems to be a basic requirement and i
feel there should be some other better way to do it.
I will file an issue , if i dont find one.

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/9b6da6cd-c960-4293-9182-0150eaa4057e%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/9b6da6cd-c960-4293-9182-0150eaa4057e%40googlegroups.com?utm_medium=email&utm_source=footer
.

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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j746fLxV8oRBm-n-X2CQ%3DzgOVsLgODYCqWm8Yta631x7w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.