Re: Get number of results in filtered query
Sounds like a job for tagging and excluding: https://cwiki.apache.org/confluence/display/solr/Faceting?focusedCommentId=42569404#Faceting-TaggingandExcludingFilters Regards, Alex. Newsletter and resources for Solr beginners and intermediates: http://www.solr-start.com/ On 14 April 2016 at 06:43, Fundera Developerwrote: > Hi all, > > we are developing a search engine in which all the possible results have one > or more countries associated. If, apart from writing the query, the user > selects a country, we use a filterquery to restrict the results to those > that match the query and are associated to that country. Nothing spectacular > so far :-D > > However, we would like to show the number of results that are returned by > the unfiltered query, since we already have the number of results associated > to each country as we are also faceting on that field. Is it possible to > have that number without executing the query twice? > > Thanks in advance! >
Re: Get number of results in filtered query
If you just do a faceted query without the filter, each facet will give you the number of results for that country and numResults will give you the total number of results across all countries. But once you apply one or more filters, numResults reflects onl the post-filtering documents. -- Jack Krupansky On Wed, Apr 13, 2016 at 4:43 PM, Fundera Developer < funderadevelo...@outlook.com> wrote: > Hi all, > > we are developing a search engine in which all the possible results have > one or more countries associated. If, apart from writing the query, the > user selects a country, we use a filterquery to restrict the results to > those that match the query and are associated to that country. Nothing > spectacular so far :-D > > However, we would like to show the number of results that are returned by > the unfiltered query, since we already have the number of results > associated to each country as we are also faceting on that field. Is it > possible to have that number without executing the query twice? > > Thanks in advance! > >
Get number of results in filtered query
Hi all, we are developing a search engine in which all the possible results have one or more countries associated. If, apart from writing the query, the user selects a country, we use a filterquery to restrict the results to those that match the query and are associated to that country. Nothing spectacular so far :-D However, we would like to show the number of results that are returned by the unfiltered query, since we already have the number of results associated to each country as we are also faceting on that field. Is it possible to have that number without executing the query twice? Thanks in advance!