You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Jason Brown <Ja...@sjp.co.uk> on 2010/10/01 15:37:32 UTC

Facet Counts Issue when Using Dismax Query Parser in SOLR

	

I am retrieving facet counts against a specific column in my index and these look accurate. The query for retrieving these counts is also running a dismax search using the q param (against 4 columns in my index, 1 of which I am facet counting on as mentioned above).

So far, so good. I show my search results, I show my facets and associated counts.

However, I want the user to be able to 'drill-down' by re-running the same search (same q param), but adding in one of the facets to filter the results. Clearly, I can't modify the q parameter to filter against my facetted column (in addition to the previous q value), as dismax wont allow a q param to have a column specified.

So I add a fq param to filter the results by the chosen facet. This seems logical, but the number of search results I get is NOT the same as the count against the facet.

I thought that by adding an fq param I am basically saying (ensuring I keep the q param the same), re-run the search but filter my results where my facetted column has value 'x'.

However as the number of results is not what I am expecting, I believe it may be using the fq param first to define the number of docs against which the q param is subsequently used. But this doesnt seem very intuitive. But it would explain the difference in the facet count and subsequent number of search results that I am observing.

Could someone help point out which of the 2 interpreations of fq is correct?

If you wish to view the St. James's Place email disclaimer, please use the link below

http://www.sjp.co.uk/portal/internet/SJPemaildisclaimer

Re: Facet Counts Issue when Using Dismax Query Parser in SOLR

Posted by Chris Hostetter <ho...@fucit.org>.
: So I add a fq param to filter the results by the chosen facet. This 
: seems logical, but the number of search results I get is NOT the same as 
: the count against the facet.

can you give us some specific examples?  Ie: show us a URL, show us 
the requestHandler config for the handler used in that URL, show us the 
output (including facet counts) of GETing that URL, then show us the URL 
you are building by adding hte fq, and show us the resulting output (with 
total result count) 

I suspect that the QParser used when building your fq may not be what you 
want.  using the "raw" (or in some cases "field") QParser in fq you build 
to deal with facet.field terms is almost always what you want - if you 
just use the default Lucene parser for fq you can get some odd siutatoions 
depending on whether your facet term has whitespace in it, and what 
analyzer is used for that field.

-Hoss

--
http://lucenerevolution.org/  ...  October 7-8, Boston
http://bit.ly/stump-hoss      ...  Stump The Chump!