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 "Wagner,Harry" <wa...@oclc.org> on 2007/12/04 16:37:45 UTC

Faceting mutiple fields with different limits

Hi,

Anyone know of a problem with faceting on more than 1 field and using a
different facet.limit for each field?  I'm using a query like:

 

...facet=true&facet.mincount=1&facet.limit=15&facet.field=fpn&facet.limi
t=-1&facet.field=ln&facet.limit=-1&facet.field=aud&facet.limit=-1&facet.
field=fmt1&debugQuery=on
<http://localhost:8080/solrf/select/?indent=on&version=2.2&start=0&rows=
20&q=s1%3a%5b0+TO+9%5d&facet=true&facet.mincount=1&facet.limit=15&facet.
field=fpn&facet.limit=-1&facet.field=ln&facet.limit=-1&facet.field=aud&f
acet.limit=-1&facet.field=fmt1&debugQuery=on> 

 

but the number of facets returned for each of the 4 fields is always
whatever I specify as the facet.limit for the 1st field (fpn in this
example).  Anyone know what I am doing wrong here?

 

Here is the header from this query:

 

<response>

    <lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">63</int>

    <lst name="params"> 
<str name="facet">true</str>
<str name="indent">on</str>
<str name="facet.mincount">1</str>

    <arr name="facet.limit">
<str>15</str>
<str>-1</str>
<str>-1</str>
<str>-1</str>
</arr>
<str name="rows">20</str>
<str name="version">2.2 </str>
<str name="debugQuery">on</str>
<str name="start">0</str>
<str name="q">s1:[0 TO 9]</str>

    <arr name="facet.field"> 
<str>fpn</str>
<str>ln</str>
<str>aud</str>
<str>fmt1</str>
</arr>
</lst>
</lst>


 

Thanks!

harry


Re: Faceting mutiple fields with different limits

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Dec 4, 2007, at 10:37 AM, Wagner,Harry wrote:
> Anyone know of a problem with faceting on more than 1 field and  
> using a
> different facet.limit for each field?  I'm using a query like:
>
>
>
> ...facet=true&facet.mincount=1&facet.limit=15&facet.field=fpn&facet.li 
> mi
> t=-1&facet.field=ln&facet.limit=-1&facet.field=aud&facet.limit=-1&face 
> t.
> field=fmt1&debugQuery=on
> <http://localhost:8080/solrf/select/? 
> indent=on&version=2.2&start=0&rows=
> 20&q=s1%3a%5b0+TO+9% 
> 5d&facet=true&facet.mincount=1&facet.limit=15&facet.
> field=fpn&facet.limit=-1&facet.field=ln&facet.limit=-1&facet.field=aud 
> &f
> acet.limit=-1&facet.field=fmt1&debugQuery=on>

HTTP parameters are just a bag of key/value parameters.  Order is not  
really something to be relied upon.  The facet feature has the  
ability to control per-field values, but you need to use different  
keys.  See here:

<http://wiki.apache.org/solr/SimpleFacetParameters>

Note this documentation:  "f.<fieldName>.<originalParam>=<value>" for  
per-field settings.  So f.fpn.limit=-1, and so on, is what you want.

	Erik