Hello,

I am new to Solr and I running some tests with our data in Solr. I am using
version 3.6 and the data is imported form a DB2 database using Solr's DIH.
We have defined a single entity in the db-data-config.xml, which is an
equivalent of the following query:
<entity name="connections"
        query="
        SELECT C.ID,
               C.ID2,
               F.CITY
               FROM
               NAME_CONNECTIONS AS C
               JOIN NAME_DETAILS AS F
               ON C.ID2 = F.ID"
>
</entity>

The ID in NAME_CONNECTIONS is not unique, so it might appear multiple times.

For the unique ID in the schema, we are using a solr.UUIDField:

<fieldType name="uuid" class="solr.UUIDField" indexed="true" />
<field name=&quot;id&quot; type=&quot;uuid&quot; indexed=&quot;true&quot;
stored=&quot;true&quot; default=&quot;NEW&quot;/

All the searchable fields are declared as indexed and stored.

I am aware of the fact that this is a very crude configuration, but for the
tests that I am running it should be enough.

The problem that I have is the different result counts that I receive when I
do equivalent queries for searching and faceting. For example, running the
following query

http://localhost:8983/solr/db/select?indent=on&amp;version=2.2&amp;q=CITY:MILTON&amp;fq=&amp;start=0&amp;rows=10&amp;fl=*&amp;wt=&amp;explainOther=&amp;hl.fl=&amp;group=true&amp;group.field=ID&amp;group.ngroups=true&amp;group.truncate=true

yields 

&lt;int name=&quot;ngroups&quot;>134</int>

as a result, which is exactly what we expect.

On the other hand, running

http://localhost:8983/solr/db/select?indent=on&version=2.2&q=*&fq=&start=0&rows=10&fl=*&wt=&explainOther=&hl.fl=&group=true&group.field=ID&group.truncate=true&facet=true&facet.field=CITY&group.ngroups=true

yields

<lst name="facet_counts">
   <lst name="facet_queries"/>
     <lst name="facet_fields">
      <lst name="CITY">
<int name="MILTON">103</int>

I would expect to have the same number (134) in this facet result as the
previous filter result. Could you please let me know why these two results
are different?

Thank you,
Tudor 


--
View this message in context: 
http://lucene.472066.n3.nabble.com/Query-results-vs-facets-results-tp3995079.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to