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
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
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.
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
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.