diff --git site/sites/all/modules/apachesolr/apachesolr_search.module site/sites/all/modules/apachesolr/apachesolr_search.module index 6151db4..35a1062 100644 --- site/sites/all/modules/apachesolr/apachesolr_search.module +++ site/sites/all/modules/apachesolr/apachesolr_search.module @@ -335,7 +335,7 @@ function apachesolr_search_execute($keys, $filterstring, $solrsort, $base_path = // No highlighting, use the teaser as a snippet. $params['fl'] .= ',teaser'; } - $has_or = apachesolr_search_add_facet_params($params, $query); + apachesolr_search_add_facet_params($params, $query); apachesolr_search_add_boost_params($params, $query, $solr); // Allow modules to alter the query prior to statically caching it. @@ -357,10 +357,16 @@ function apachesolr_search_execute($keys, $filterstring, $solrsort, $base_path = return array(); } - if (!$has_or && ('' == $keys) && isset($params['fq'])) { + if (('' == $keys) && isset($params['fq'])) { // Move the fq params to the q.alt for better performance. - $params['q.alt'] = implode(' ', $params['fq']); - unset($params['fq']); + $move_fq = array(); + foreach($params['fq'] as $delta => $value) { + if (!preg_match('/^(?:\{!|-)/', $value)) { + $move_fq[] = $value; + unset($params['fq'][$delta]); + } + } + $params['q.alt'] = implode(' ', $move_fq); } $response = $solr->search($query->get_query_basic(), $params['start'], $params['rows'], $params); // The response is cached so that it is accessible to the blocks and anything