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 mi...@sas.upenn.edu on 2007/04/30 17:02:28 UTC

numFound for facet results

Hi,

could you tell me what is the (simplest|elegant|fast) way of implementing
the following:

I use faceted browsing, but I limit the number of facet counts to 5 (i.e.,
facet.limit=5).

1. I would like to be able to show if there are more facet values
(this can be achieved with the trick for asking 6 values and only displaying 5
and if the 6th is non-empty obviously there are more than 5 :)

2. I would like to be able to tell how many facet values are there
total.  (This would be a value like numFound for the results).
Is there such a thing or a workaround like for 1.

thanks,
mirko

Re: numFound for facet results

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Apr 30, 2007, at 11:16 AM, Yonik Seeley wrote:

> On 4/30/07, mirko@sas.upenn.edu <mi...@sas.upenn.edu> wrote:
>
>> 2. I would like to be able to tell how many facet values are there
>> total.  (This would be a value like numFound for the results).
>> Is there such a thing or a workaround like for 1.
>
> Number of facet values in the field (independent of the query), or
> number of non-zero facet counts for the particular query?
> The former will be relatively easy, the latter can't really be done
> that efficiently.

I'm sure that the need is the latter.   At least for me that would be  
helpful.

Even if the faceting had a feature to still compute all the facets  
but limit the response to a given amount and provide a total (given  
the current constraints) facet values it'd at least reduce the  
communication over the wire.  I think that'd make a big difference in  
performance for one of my applications where we have an unusually  
large number of facet values.

	Erik


Re: numFound for facet results

Posted by Yonik Seeley <yo...@apache.org>.
On 4/30/07, mirko@sas.upenn.edu <mi...@sas.upenn.edu> wrote:
> could you tell me what is the (simplest|elegant|fast) way of implementing
> the following:
>
> I use faceted browsing, but I limit the number of facet counts to 5 (i.e.,
> facet.limit=5).
>
> 1. I would like to be able to show if there are more facet values
> (this can be achieved with the trick for asking 6 values and only displaying 5
> and if the 6th is non-empty obviously there are more than 5 :)

That's a decent workaround.

> 2. I would like to be able to tell how many facet values are there
> total.  (This would be a value like numFound for the results).
> Is there such a thing or a workaround like for 1.

Number of facet values in the field (independent of the query), or
number of non-zero facet counts for the particular query?
The former will be relatively easy, the latter can't really be done
that efficiently.

-Yonik