diff --git a/src/AdvancedSearchQuery.php b/src/AdvancedSearchQuery.php index a072831..694d003 100644 --- a/src/AdvancedSearchQuery.php +++ b/src/AdvancedSearchQuery.php @@ -160,9 +160,11 @@ class AdvancedSearchQuery { $isSearchAllFields = false; $fields_list = []; + if (!$isDismax) { + // To support negative queries we must first bring in all documents. + $q[] = $this->negativeQuery($terms) ? "*:*" : ""; + } - // To support negative queries we must first bring in all documents. - $q[] = $this->negativeQuery($terms) ? "*:*" : ""; $term = array_shift($terms); $q[] = $term->toSolrQuery($field_mapping);