Erick Erickson wrote
> 
> Ahhh, you need to look down another few lines. When you specify fq, there
> should be a section of the debug output like
> <arr name="filter_queries">
>   .
>   .
>   .
> </arr>
> 
> where the array is the parsed form of the filter queries. I was thinking
> about
> comparing that with the parsed form of the "q" parameter in the non-filter
> case to see what insight one could gain from that.
> 
> 

There is no "filter_queries" section because I do not use an fq in the first
two queries. I use one in the combined query, for which you can see the
output further below.


Erick Erickson wrote
> 
> 
> But there's already one difference, when you use *, you get
>  <str name="parsedquery">ID:*</str>
> 
> Is it possible that you have some documents that do NOT have an ID field?
> try *:* rather than just *. I'm guessing that your default search field is
> ID
> and you have some documents without an ID field. Not a good guess if ID
> is your <uniqueKey> though......
> 
> Try q=*:* -ID:* and see if you get 31 docs.
> 
> 

All the entries have an ID, so q=*:* -ID:* yielded 0 results.
The ID could appear multiple times, that is the reason behind grouping of
results. Indeed, ID is the default search field.


Erick Erickson wrote
> 
> 
> Also note that if you _have_ specified ID as your <uniqueKey> _but_ you
> didn't
> re-index afterwards (actually, I'd blow away the entire
> <solrhome>/data directory
> and restart) you may have stale data in there that allowed documents to
> exist
> that do not have uniqueKey fields.....
> 
> 

For Solr's unique id I use a <fieldType name="uuid" class="solr.UUIDField"
indexed="true" /> field (which, of course, has a different name than the
default search ID), so it should not be a problem.

I have re-indexed the data, and I get somewhat a different result. This is
the query:

http://localhost:8983/solr/db/select?indent=on&version=2.2&q=*:*&fq={!tag=dt}CITY:MILTON&start=0&rows=10&fl=*&wt=&explainOther=&hl.fl=&group=true&group.field=STR_ENTERPRISE_ID&group.truncate=true&facet=true&facet.field={!ex=dt}CITY&facet.missing=true&group.ngroups=true&debugQuery=on

And the results as well as the debug information:

<lst name="grouped">
  <lst name="ID">
  <int name="matches">284</int>
  <int name="ngroups">134</int>
  <arr name="groups"></arr>
   ...

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

<lst name="debug">
  <str name="rawquerystring">*:*</str>
  <str name="querystring">*:*</str>
  <str name="parsedquery">MatchAllDocsQuery(*:*)</str>
  <str name="parsedquery_toString">*:*</str>
  <lst name="explain"></lst>
  <str name="QParser">LuceneQParser</str>
  <arr name="filter_queries">
  <str>{!tag=dt}CITY:MILTON</str>
  </arr><arr name="parsed_filter_queries">
  <str>CITY:MILTON</str>
  </arr>
  <lst name="timing"></lst>
</lst>

So now fq says: 134 groups with CITY:MILTON and faceted search says: 83
groups with CITY:MILTON. 

How can I see some information about the grouping in Solr?

Thanks Erick!

Regards,
Tudor


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

Reply via email to