I have two 'types' in an index, or two indices of different types (I'd
prefer the latter but can live with the former).
I'm running an aggregation by type to implement what my UX people refer to
as faceted search — which makes Googling for ES help quite tricky.
UX would like to filter by type but retain a count for total hits in each
aggregation bucket — it the total number of each type of record that
matches the query.
Can this be done in one query?
Failing that, can two queries be supplied/run in parallel?
I have two 'types' in an index, or two indices of different types (I'd
prefer the latter but can live with the former).
I'm running an aggregation by type to implement what my UX people refer to
as faceted search — which makes Googling for ES help quite tricky.
UX would like to filter by type but retain a count for total hits in each
aggregation bucket — it the total number of each type of record that
matches the query.
Can this be done in one query?
Failing that, can two queries be supplied/run in parallel?
Not being too sure of the essence of your question let me fire some random
info at you
If you use a query (rather than filter) then the aggregation will
reflect the totals for that query. ie the query is global.
If you want to do an aggregation that is independent of that query, then
you have to set its scope to 'global' - (I cant remember the exact syntax
right now).
If you want to apply another filter criteria, use a filter aggregation
first, then your subaggregations below that (you can nest aggregations)
Sometimes with a faceted search, you want to show the totals of various
categories based on the search criteria that already exists. You sometimes
find you also want to show the categories for which there are zero
applicable documents (possibly because the chosen filter criteria are such
that they no longer match) - for that you need to do two aggregations - 1
to get the the totals - plus global one to get all the categories that have
count zero with the current criteria.
I hope that helps in some way....
On Sunday, 7 September 2014 13:57:40 UTC+1, Lee Gee wrote:
I have two 'types' in an index, or two indices of different types (I'd
prefer the latter but can live with the former).
I'm running an aggregation by type to implement what my UX people refer to
as faceted search — which makes Googling for ES help quite tricky.
UX would like to filter by type but retain a count for total hits in each
aggregation bucket — it the total number of each type of record that
matches the query.
Can this be done in one query?
Failing that, can two queries be supplied/run in parallel?
I have two 'types' in an index, or two indices of different types (I'd
prefer the latter but can live with the former).
I'm running an aggregation by type to implement what my UX people refer to
as faceted search — which makes Googling for ES help quite tricky.
UX would like to filter by type but retain a count for total hits in each
aggregation bucket — it the total number of each type of record that
matches the query.
Can this be done in one query?
Failing that, can two queries be supplied/run in parallel?
On Sunday, September 7, 2014 1:57:40 PM UTC+1, Lee Gee wrote:
I have two 'types' in an index, or two indices of different types (I'd
prefer the latter but can live with the former).
I'm running an aggregation by type to implement what my UX people refer to
as faceted search — which makes Googling for ES help quite tricky.
UX would like to filter by type but retain a count for total hits in each
aggregation bucket — it the total number of each type of record that
matches the query.
Can this be done in one query?
Failing that, can two queries be supplied/run in parallel?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.