Limiting buckets on histogram agg

So I am getting up to speed with elastic search and I was surprised to find
no way to set the number of buckets for a histogram.

In my use case, I have a index of search clicks and one of the parameters
is the item rank within returned search results.

I want to have an aggregation that shows the number search clicks in the
first position, second position ....

So for this I need to set the interval to 1. But some of these can have a
significant number of clicks with a very long tail with larger page ranks
having very small number of clicks.

I would like to say to the histogram, just return me what is in the first
20 buckets.

Seems like in addition to the interval, a size setting would also be needed
to accomplish this.

I am trying to reproduce how the terms panel in Kibana works, but do not
want to implement using facets, would rather do this with aggregations.

Thanks in advance

--
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/df22a825-983f-4264-82c7-ed7e0f5718f0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hi Doug,

I am not sure to understand what the aggregation that you are building
looks like. Can you provide us with your aggregation and a example of what
your documents look like?

On Thu, Sep 4, 2014 at 12:04 AM, Doug Nelson doug.nelson@gmail.com wrote:

So I am getting up to speed with Elasticsearch and I was surprised to
find no way to set the number of buckets for a histogram.

In my use case, I have a index of search clicks and one of the parameters
is the item rank within returned search results.

I want to have an aggregation that shows the number search clicks in the
first position, second position ....

So for this I need to set the interval to 1. But some of these can have
a significant number of clicks with a very long tail with larger page ranks
having very small number of clicks.

I would like to say to the histogram, just return me what is in the first
20 buckets.

Seems like in addition to the interval, a size setting would also be
needed to accomplish this.

I am trying to reproduce how the terms panel in Kibana works, but do not
want to implement using facets, would rather do this with aggregations.

Thanks in advance

--
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/df22a825-983f-4264-82c7-ed7e0f5718f0%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/df22a825-983f-4264-82c7-ed7e0f5718f0%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/CAL6Z4j5fPDgYYuxWP%2BP8gzeHKNqpxyAGo%2Bo5AFAykbWgfU7ozQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Hello Doug ,

There is an issue for this -

Thanks
Vineeth

On Thu, Sep 4, 2014 at 3:34 AM, Doug Nelson doug.nelson@gmail.com wrote:

So I am getting up to speed with Elasticsearch and I was surprised to
find no way to set the number of buckets for a histogram.

In my use case, I have a index of search clicks and one of the parameters
is the item rank within returned search results.

I want to have an aggregation that shows the number search clicks in the
first position, second position ....

So for this I need to set the interval to 1. But some of these can have
a significant number of clicks with a very long tail with larger page ranks
having very small number of clicks.

I would like to say to the histogram, just return me what is in the first
20 buckets.

Seems like in addition to the interval, a size setting would also be
needed to accomplish this.

I am trying to reproduce how the terms panel in Kibana works, but do not
want to implement using facets, would rather do this with aggregations.

Thanks in advance

--
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/df22a825-983f-4264-82c7-ed7e0f5718f0%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/df22a825-983f-4264-82c7-ed7e0f5718f0%40googlegroups.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/CAGdPd5kisJ7pEP6Bhx-CE%3DtExnew3%3DZjTk3kDRt-_%3DwaTDjXGA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Add this also - Support for size and order in all bucket aggregations · Issue #6704 · elastic/elasticsearch · GitHub
, Add "size" parameter to historgram aggregation (limit number of returned results) · Issue #7103 · elastic/elasticsearch · GitHub

Thanks
Vineeth

On Thu, Sep 4, 2014 at 7:55 AM, vineeth mohan vm.vineethmohan@gmail.com
wrote:

Hello Doug ,

There is an issue for this -
Limit faceting to top N hits · Issue #2040 · elastic/elasticsearch · GitHub

Thanks
Vineeth

On Thu, Sep 4, 2014 at 3:34 AM, Doug Nelson doug.nelson@gmail.com wrote:

So I am getting up to speed with Elasticsearch and I was surprised to
find no way to set the number of buckets for a histogram.

In my use case, I have a index of search clicks and one of the parameters
is the item rank within returned search results.

I want to have an aggregation that shows the number search clicks in the
first position, second position ....

So for this I need to set the interval to 1. But some of these can have
a significant number of clicks with a very long tail with larger page ranks
having very small number of clicks.

I would like to say to the histogram, just return me what is in the first
20 buckets.

Seems like in addition to the interval, a size setting would also be
needed to accomplish this.

I am trying to reproduce how the terms panel in Kibana works, but do not
want to implement using facets, would rather do this with aggregations.

Thanks in advance

--
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/df22a825-983f-4264-82c7-ed7e0f5718f0%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/df22a825-983f-4264-82c7-ed7e0f5718f0%40googlegroups.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%3DasRRx3-KEX-WZf9XLRFo9o%2Bnhf8gOG8hPjwvAB5B12A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

thanks vineeth,

I +1 these in the issues.

I was able to solve this by using two queries and in the histogram buckets,
I simply used a range filter to limit the number of buckets. Each bucket
has the has the information I need, but I need to get the total count from
the overall (without the range filter).

On Wednesday, September 3, 2014 9:29:58 PM UTC-5, vineeth mohan wrote:

Add this also - Support for size and order in all bucket aggregations · Issue #6704 · elastic/elasticsearch · GitHub
, Add "size" parameter to historgram aggregation (limit number of returned results) · Issue #7103 · elastic/elasticsearch · GitHub

Thanks
Vineeth

On Thu, Sep 4, 2014 at 7:55 AM, vineeth mohan <vm.vine...@gmail.com
<javascript:>> wrote:

Hello Doug ,

There is an issue for this -
Limit faceting to top N hits · Issue #2040 · elastic/elasticsearch · GitHub

Thanks
Vineeth

On Thu, Sep 4, 2014 at 3:34 AM, Doug Nelson <doug....@gmail.com
<javascript:>> wrote:

So I am getting up to speed with Elasticsearch and I was surprised to
find no way to set the number of buckets for a histogram.

In my use case, I have a index of search clicks and one of the
parameters is the item rank within returned search results.

I want to have an aggregation that shows the number search clicks in
the first position, second position ....

So for this I need to set the interval to 1. But some of these can
have a significant number of clicks with a very long tail with larger page
ranks having very small number of clicks.

I would like to say to the histogram, just return me what is in the
first 20 buckets.

Seems like in addition to the interval, a size setting would also be
needed to accomplish this.

I am trying to reproduce how the terms panel in Kibana works, but do not
want to implement using facets, would rather do this with aggregations.

Thanks in advance

--
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 elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/df22a825-983f-4264-82c7-ed7e0f5718f0%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/df22a825-983f-4264-82c7-ed7e0f5718f0%40googlegroups.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/f67f2bb8-2d08-4fbe-8e0c-839aa7b0bced%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.