0
votes

We have a SOLR 5.2.1 cluster and we have around 70M documents indexed. One problem which I am facing currently is that when we facet on one field with one filter condition i don't see a certain facetted value in response.For example following is the query which is getting fired on SOLR : http://HOST:/solr/shard3_replica1/select?q=:&facet.mincount=1&rows=0&facet=true&facet.field=cId&fq=ctId:123456

So in response facets are getting returned but one value(for instance cId : 9999999 ) is not returned. But if we apply filter for the same value along with original filter I can see the data in response.For example : http://HOST:/solr/shard3_replica1/select?q=:&facet.mincount=1&rows=0&facet=true&facet.field=cId&fq=ctId:123456&fq=cgId:9999999

I can very well see that facet values are returned.

Following is the relevant schema definition for the fields:

<field name="cId" type="text_general" indexed="true" stored="true"/>
<field name="ctId" type="text_general" indexed="true" stored="true" multiValued="true"/>

<fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
            <analyzer type="index">
                <tokenizer class="solr.StandardTokenizerFactory"/>
                <filter class="solr.LowerCaseFilterFactory"/>
            </analyzer>
            <analyzer type="query">
                <tokenizer class="solr.StandardTokenizerFactory"/>
                <filter class="solr.LowerCaseFilterFactory"/>
            </analyzer>
        </fieldType>

I created a sample collection with same configuration in my local solr setup and ingested same data.In that collection both the above queries are working fine.

Any help would be really appreciated. Thanks in advance.

1

1 Answers

0
votes

Since you're not giving a value for facet.limit, Solr will default to only return the 100 most popular values for the field. I'd also recommend using an non-tokenized field for faceting, but if it works for your use case - sure. But be aware that this will create separate tokens for 00-00 and multiple other formats.

facet.limit

This parameter specifies the maximum number of constraint counts (essentially, the number of facets for a field that are returned) that should be returned for the facet fields. A negative value means that Solr will return unlimited number of constraint counts.

The default value is 100.