Ah yes I did misunderstand the question, I thought he was just saying the count was not the same as what the facet in the first query had returned.
MJ On Thu, Jun 2, 2016 at 2:11 PM, Robert Brown <r...@intelcompute.com> wrote: > MaryJo, I think you've mis-understood. The counts are different simply > because the 2nd query contains an filter of a facet value from the 1st > query - that's completely expected. > > The issue is how to get the original facet counts (with no filters but > same q) in the same call as also filtering by one of those facet values. > > Personally I don't think it's possible, but will be interested to hear > others input, since it's a very common situation for me - I cache the first > result in memcached and tag future queries as related to the first. > > Or could you always make 2 calls back to Solr (one original (again), and > one with the filters), the caches should help massively. > > > > On 02/06/16 19:07, MaryJo Sminkey wrote: > >> And you're saying the count for the second query is different than what >> was >> returned in the facet? You may need to check for any defaults you have set >> up in the solrconfig for the select parser, if for instance you have any >> grouping going on, but aren't doing grouping in your facet, that could >> result in the counts being off. >> >> MJ >> >> >> >> >> On Thu, Jun 2, 2016 at 2:01 PM, Jamal, Sarfaraz < >> sarfaraz.ja...@verizonwireless.com.invalid> wrote: >> >> Absolutely, >>> >>> Here is what it looks like: >>> >>> This brings the right counts as it should >>> http:// >>> >>> **********select?q=video&hl=true&hl.fl=*&hl.snippets=20&facet=true&facet.field=team >>> >>> Then when I specify which team >>> http:// >>> >>> **********select?q=video&hl=true&hl.fl=*&hl.snippets=20&facet=true&facet.field=team&fq=team:rollback >>> >>> The counts are obviously different now, as the result set is limited to >>> one team. >>> >>> Sas >>> >>> -----Original Message----- >>> From: MaryJo Sminkey [mailto:mjsmin...@gmail.com] >>> Sent: Thursday, June 2, 2016 1:56 PM >>> To: solr-user@lucene.apache.org >>> Subject: [E] Re: Faceting Question(s) >>> >>> Jamai - what is your q= set to? And do you have a fq for the original >>> query? I have found that if you do a wildcard search (*.*) you have to be >>> careful about other parameters you set as that can often result in the >>> numbers returned being off. In my case, my defaults had things like >>> edismax >>> settings for phrase boosting, etc. that don't apply if there isn't a >>> search >>> term, and once I removed those for a wildcard search I got the correct >>> numbers. So possibly your facet query itself may be set up correctly but >>> something else in the parameters and/or filters with the two queries may >>> be >>> the cause of the difference. >>> >>> Mary Jo >>> >>> >>> On Thu, Jun 2, 2016 at 1:47 PM, Jamal, Sarfaraz < >>> sarfaraz.ja...@verizonwireless.com.invalid> wrote: >>> >>> Hello Everyone, >>>> >>>> I am working on implementing some basic faceting into my project. >>>> >>>> I have it working the way I want to, but I feel like there is probably >>>> a better way the way I went about it. >>>> >>>> * I want to show a category and its count. >>>> * when someone clicks a category, it sets a FQ= to that category. >>>> >>>> But now that the results are being filtered, the category counts from >>>> the original query without the filters are off. >>>> >>>> So, I have a single api call that I make with rows set to 0 and the >>>> base query without any filters, and use that to display my categories. >>>> >>>> And then I call the api again, this time to get the results. And the >>>> category count is the same. >>>> >>>> I hope that makes sense. >>>> >>>> I was hoping facet.query would be of help, but I am not sure I >>>> understood it properly. >>>> >>>> Thanks in advance =) >>>> >>>> Sas >>>> >>>> >