I am using Apachesolr module with Drupal 6. I have only one facet so far on my searching and that is the node type. I have a list of links that is supposed to filter the query. When I put in a search term, I get all the matching results and the list of links with the correct counts for each node type. However, when I click a node type it returns just the result for that node type, but now all the counts in my link list have turned to 0, except for that node type which shows the correct amount, I have it set a $_REQUEST['filter'] parameter. In my hook_solrsearch_apachesolr_prepare_query, I check for the existence and value of this filter. To filter the query I use $query->add_filter('type', 'node_type');. I have also tried setting the ['fq'] in that hook with $params['fq'] = 'type:node_type', but that has no effect on the results.
I generate the list of links by setting $response = apachesolr_static_response_cache(); and using $response->response->numFound->facet_fields->type->node_type.
I know I am missing something here, but I can't figure out what. When the query runs with the filter for a certain node type, it is only logical that $response->response->numFound->facet_fields->type->node_type would return a count of 0 for all other node types.
How can I filter the results by the node type the way I would like to, but keep my counts for the Type facet correct for all other node types? Drupal.org does this really well. Anyone know how that can be accomplished.