Facets only on hits actually returned

This may sound like a strange question but is there a way to get facets
only for the hits actually returned? So for example, if there are 100k
total hits but I only asked for 100 in the size parameter, I only want the
facets on the 100 actually returned. Obviously I could just go through the
100 results and do the aggregation myself but wanted to see if there was a
way to let elasticsearch/lucene do it. I know there is facet scopes and
facet filters but I just need the facets on the actual returned hits.
much thanks

-T

--
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/abd1de9e-b85f-4ff1-909f-43226dabbda4%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

I think that if you add a limit filter in your FilteredQuery it should work.
But only for the 1st page.

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-limit-filter.html

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 25 janv. 2014 à 02:04, Tinou Bao tinou.bao@gmail.com a écrit :

This may sound like a strange question but is there a way to get facets only for the hits actually returned? So for example, if there are 100k total hits but I only asked for 100 in the size parameter, I only want the facets on the 100 actually returned. Obviously I could just go through the 100 results and do the aggregation myself but wanted to see if there was a way to let elasticsearch/lucene do it. I know there is facet scopes and facet filters but I just need the facets on the actual returned hits. much thanks

-T

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/abd1de9e-b85f-4ff1-909f-43226dabbda4%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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/FDCBABDC-E790-483F-B47B-7C82ACD8B2EA%40pilato.fr.
For more options, visit https://groups.google.com/groups/opt_out.

There is an open issue for this request, but no comment from the
elasticsearch team in two years:

I have a vague how to implement such as feature with the old facets, but
not with the new aggregation framework. No clue if it would make the task
easier or not. Perhaps I should look into it.

Ivan

On Fri, Jan 24, 2014 at 10:37 PM, David Pilato david@pilato.fr wrote:

I think that if you add a limit filter in your FilteredQuery it should
work.
But only for the 1st page.

Elasticsearch Platform — Find real-time answers at scale | Elastic

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 25 janv. 2014 à 02:04, Tinou Bao tinou.bao@gmail.com a écrit :

This may sound like a strange question but is there a way to get facets
only for the hits actually returned? So for example, if there are 100k
total hits but I only asked for 100 in the size parameter, I only want the
facets on the 100 actually returned. Obviously I could just go through the
100 results and do the aggregation myself but wanted to see if there was a
way to let elasticsearch/lucene do it. I know there is facet scopes and
facet filters but I just need the facets on the actual returned hits.
much thanks

-T

--
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/abd1de9e-b85f-4ff1-909f-43226dabbda4%40googlegroups.com
.
For more options, visit https://groups.google.com/groups/opt_out.

--
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/FDCBABDC-E790-483F-B47B-7C82ACD8B2EA%40pilato.fr
.

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

--
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/CALY%3DcQCKEpc9DcGUiG9TyP9CXaOhHREqRsi8LRBfywwDjtw_-w%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.