title: SOLR faceting slower than manual count?
body: <p>I'm trying to get SOLR range query working. I have a database with over 12 milion documents, and i am filtering by few parameters for example:</p>
  
  <pre><code>product_category:"category1" AND product_group:"group1" AND product_manu:"manufacturer1"
  </code></pre>
  
  <p>The query itself returns about 700 documents and executes in two-three seconds on average.</p>
  
  <p>But when i want to add date range facet to that query (i want to see how many products were added each day for past x years) it executes in 50 seconds or more. So it seems that it would be faster to just retrieve all matching documents and perform manual counting in java. 
  So i guess i must be doing something wrong with faceting?</p>
  
  <p>here is an example faceted query:</p>
  
  <pre><code>start=0&amp;rows=0&amp;facet.query=productDate%3A[0999-12-26T23%3A36%3A00.000Z+TO+2012-05-22T15%3A58%3A05.232Z]&amp;q=source%3A%22source1%22+AND+productCategory%3A%22category1%22+AND+type%3A%22type1%22&amp;facet=true&amp;facet.limit=-1&amp;facet.sort=count&amp;facet.range=productDate&amp;facet.range.start=NOW%2FDAY-5000DAYS&amp;facet.range.end=NOW%2FDAY%2B1DAY&amp;facet.range.gap=%2B1DAY
  </code></pre>
  
  <p>My only explanation is that SOLR is counting fields on some larger document pool than my 700 documents resulting from "q=" parameter. Or maybe i should filter documents in another way?</p>
  
  <p>I have tried changing filterCache size and it works, but it seems to be a waste of memory for queries like these. After all aggregating over 700 documents should be very fast shouldnt it?</p>