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 Erik Fäßler <er...@uni-jena.de> on 2011/05/19 15:56:58 UTC

Facetting: Some questions concerning method:fc

  Hey all!

I have a few questions concerning the field cache method for faceting.
The wiki says for enum method: "This was the default (and only) method 
for faceting multi-valued fields prior to Solr 1.4. ". And for fc 
method: "This was the default method for single valued fields prior to 
Solr 1.4. ".
I just ran into the problem of using fc for a field which can have 
multiple terms for one field. The facet counts would be wrong, seemingly 
only counting the first term in the field of each document. I observed 
this in Solr 1.4.1 and in 3.1 with the same index.

Question 1: The quotes above say "prior to Solr 1.4". Has this changed? 
Is there another method for multi-valued faceting since Solr 1.4?
Question 2: Very weird is another observation: When faceting on another 
field, namely the "text" field holding a large variety of terms and 
especially a lot of different terms in one single field, the fc method 
seems to count everything correctly. In fact, the results between fc and 
enum don't seem to differ. The field in which the fc and enum faceting 
results differ consists of a lot of terms which have all start- end end 
offsets 0, 0 and position increment 1. Could this be a problem?

Best regards,

     Erik

Re: Facetting: Some questions concerning method:fc

Posted by Erik Fäßler <er...@uni-jena.de>.
  Am 19.05.2011 16:07, schrieb Yonik Seeley:
> On Thu, May 19, 2011 at 9:56 AM, Erik Fäßler<er...@uni-jena.de>  wrote:
>> I have a few questions concerning the field cache method for faceting.
>> The wiki says for enum method: "This was the default (and only) method for
>> faceting multi-valued fields prior to Solr 1.4. ". And for fc method: "This
>> was the default method for single valued fields prior to Solr 1.4. ".
>> I just ran into the problem of using fc for a field which can have multiple
>> terms for one field. The facet counts would be wrong, seemingly only
>> counting the first term in the field of each document. I observed this in
>> Solr 1.4.1 and in 3.1 with the same index.
> That doesn't sound right... the results should always be identical
> between facet.method=fc and facet.method=enum. Are you sure you didn't
> index a multi-valued field and then change the fieldType in the schema
> to be single valued? Are you sure the field is indexed the way you
> think it is?  If so, is there an easy way for someone to reproduce
> what you are seeing?
>
> -Yonik
> http://www.lucenerevolution.org -- Lucene/Solr User Conference, May
> 25-26, San Francisco
Thanks a lot for your help: Changing the field type to "multiValued" did 
the trick. The point is, I built the index using Lucene directly (I need 
to for some special manipulation of offsets and position increments). So 
my question is which requirements a Lucene field has to fulfill so 
Solr's faceting works correctly.
Particular question: In Lucene terms, what exactly is denoted by a 
"multiValued" field? I thought that would result in multiple Lucene 
Field instances with the same name for a single document. But I think my 
field has only one instance per document (but I could check that back).

Thanks again for your quick and helpful answer!

     Erik

Re: Facetting: Some questions concerning method:fc

Posted by Yonik Seeley <yo...@lucidimagination.com>.
On Thu, May 19, 2011 at 9:56 AM, Erik Fäßler <er...@uni-jena.de> wrote:
> I have a few questions concerning the field cache method for faceting.
> The wiki says for enum method: "This was the default (and only) method for
> faceting multi-valued fields prior to Solr 1.4. ". And for fc method: "This
> was the default method for single valued fields prior to Solr 1.4. ".
> I just ran into the problem of using fc for a field which can have multiple
> terms for one field. The facet counts would be wrong, seemingly only
> counting the first term in the field of each document. I observed this in
> Solr 1.4.1 and in 3.1 with the same index.

That doesn't sound right... the results should always be identical
between facet.method=fc and facet.method=enum. Are you sure you didn't
index a multi-valued field and then change the fieldType in the schema
to be single valued? Are you sure the field is indexed the way you
think it is?  If so, is there an easy way for someone to reproduce
what you are seeing?

-Yonik
http://www.lucenerevolution.org -- Lucene/Solr User Conference, May
25-26, San Francisco