If a client configures this module with content type exclusions and removes one or more of the excluded content types from the site, the apachesolr_multisitesearch_query_exclusions variable will still contain those now removed content types within the array until the configuration page is re-saved.

The search query is still altered with these invalid bundles as fq arguments but without a field value:
(excerpt from query sent to Solr)
&fq=-bundle_name%3A%22Advanced%20Poll%22 <= "Advanced Poll" content type still present
&fq=-bundle_name%3A <= No longer existing content type
&fq=-bundle_name%3A <= No longer existing content type

This results in the search query having syntax errors and prevents Solr search from working entirely.

I would suggest doing an additional check within apachesolr_multisitesearch_apachesolr_query_alter() to make sure that $query_exclusion_options[$key] is not empty.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jastraat’s picture

Issue summary: View changes
janusman’s picture

Status: Active » Needs review
FileSize
814 bytes

Attached patch, please review.

rob.costello’s picture

I was having the same issue and this patch sorted it. Thanks!

  • janusman authored ed00aff on 7.x-1.x
    Issue #2139477 by janusman: Empty Solr fq arguments sent when node types...
janusman’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.