title: Sunspot Solr - working with facets
body: <p>I have setup faceted search using Sunspot, SOLR. Like this:</p>
  
  <pre><code>for row in @search.facet(:facet_id).rows
      link_to row.instance.name, :url_for(:search =&gt; params[:q], :facet_id =&gt; row.value)
  </code></pre>
  
  <p>My issue is that when I execute the faceted search in the controller like this:</p>
  
  <pre><code>    @search = Sunspot.search(MyModel) do
        keywords search_text 
        facet    :facet_id
        with(:facet_id, params[:facet_id]) if params[:facet_id].present?
      end
  </code></pre>
  
  <p>The facet counts are now calculated based on the with(:facet_id, params[:facet_id]) condition. I want the facet counts to ALWAYS be calculated without this condition.</p>
  
  <p>Do I need to execute two searches? One for the search without the conditions (to calculate the facet counts) and one with the condition to retrieve the results. Or is there a way to do this in one SOLR query.</p>
  
  <p>Thanks</p>
  
  <p>Hamish</p>