lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shawn Heisey <apa...@elyograg.org>
Subject Re: Solr date range returns wrong number of results
Date Thu, 18 Aug 2016 13:17:37 GMT
On 8/18/2016 1:43 AM, Tali Finelt wrote:
> I am using Solr 6 in SolrCloud mode and trying to filter results according 
> to a date range. 
>
> The date field is defined as following in the managed_schema file:
> <field name="date" type="date" indexed="true" stored="true" 
> required="false" multiValued="false" />
>
> When I run the following query:
>
> https://<HOST_NAME>:8983/solr/<NAME>/select?q=date:[2016-08-02T04:43:38Z

> TO 2016-08-02T05:43:38Z]&rows=10
<snip>
> For some reason, I only get 7 documents back and not 10 as I asked  (by 
> parameter "rows=10").
> I know there are more then 7 documents according to the "numFound" 
> parameter  (=325313)

My best guess, which could be wrong, is that you have documents with the
same uniqueKey in more than one shard of your collection.  With
SolrCloud, this usually happens when the router is implicit, or when
routing is overridden.  The implicit router is correctly named, but the
meaning is often misunderstood.  The best interpretation of its meaning
is "manual routing."

When this problem happens you may find that numFound sometimes changes
when running the same query more than once, even when the index hasn't
changed.  What router are you using on your collection, and are you
influencing the routing when you index?

> This problem persists on different date ranges I query on. 
> This does not happen when I filter on other fields in my schema. 
>
> What am I doing wrong?
> How can I get 10 results back?

If I'm right about what's happening, then the fix would be to eliminate
the duplicate documents.

Side issue:  Is that a literal paste of the full response, or were there
contents inside the <doc> tags?  The XML that was pasted had plus signs
next to the <doc> tags, which might have come from those tags being
collapsed.

Thanks,
Shawn


Mime
View raw message