Aggregation equivalent of Facet "global" : true?


#1

Is there a way of specifying the scope of an aggregation (if there is I
cant seem to find it)?

I want to achieve the equivalent of a Facet "global" : true.

Do I need to use facets instead of aggregations in this case?

I am just doing term aggregations - to give the user a dropdown list to
filter by, say, commodity - and provide choices like:
Aluminium (0)
Copper (110)
Gold (6)
Lead (243)
Zinc (0)

I want to do a global aggregation to get all the possible terms (ie all
possible filter values).
I want to do a contextual (based on current user query) term aggregation to
get the counts.

How do I do this with Aggregations?

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/2ea2b66e-5274-4d04-a4b4-dabef399db13%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Adrien Grand) #2

You can do this by running a global aggregation:
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-global-aggregation.html

On Wed, Jun 11, 2014 at 12:02 PM, mooky nick.minutello@gmail.com wrote:

Is there a way of specifying the scope of an aggregation (if there is I
cant seem to find it)?

I want to achieve the equivalent of a Facet "global" : true.

Do I need to use facets instead of aggregations in this case?

I am just doing term aggregations - to give the user a dropdown list to
filter by, say, commodity - and provide choices like:
Aluminium (0)
Copper (110)
Gold (6)
Lead (243)
Zinc (0)

I want to do a global aggregation to get all the possible terms (ie all
possible filter values).
I want to do a contextual (based on current user query) term aggregation
to get the counts.

How do I do this with Aggregations?

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/2ea2b66e-5274-4d04-a4b4-dabef399db13%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/2ea2b66e-5274-4d04-a4b4-dabef399db13%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/CAL6Z4j7oewksDpV0Nkqoczw5Wkjq4uO2m%2B4eDZcshSu5Yb5HyQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


#3

Aha. I missed that. Many thanks.

On Wednesday, 11 June 2014 11:23:57 UTC+1, Adrien Grand wrote:

You can do this by running a global aggregation:
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-global-aggregation.html

On Wed, Jun 11, 2014 at 12:02 PM, mooky <nick.mi...@gmail.com
<javascript:>> wrote:

Is there a way of specifying the scope of an aggregation (if there is I
cant seem to find it)?

I want to achieve the equivalent of a Facet "global" : true.

Do I need to use facets instead of aggregations in this case?

I am just doing term aggregations - to give the user a dropdown list to
filter by, say, commodity - and provide choices like:
Aluminium (0)
Copper (110)
Gold (6)
Lead (243)
Zinc (0)

I want to do a global aggregation to get all the possible terms (ie all
possible filter values).
I want to do a contextual (based on current user query) term aggregation
to get the counts.

How do I do this with Aggregations?

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 elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/2ea2b66e-5274-4d04-a4b4-dabef399db13%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/2ea2b66e-5274-4d04-a4b4-dabef399db13%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/86b96aae-6a71-4e47-a605-3db55a120905%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #4