diff --git a/src/AdvancedSearchQueryTerm.php b/src/AdvancedSearchQueryTerm.php index 161fc3b..ab9db12 100644 --- a/src/AdvancedSearchQueryTerm.php +++ b/src/AdvancedSearchQueryTerm.php @@ -302,7 +302,8 @@ class AdvancedSearchQueryTerm { return $value; } else { - return "(" .$value . " OR " . str_replace('"', "", trim($value)) . ")"; + $isNot = $this->getInclude() ? "" : "!"; + return $isNot . "(" .$value . " OR " . str_replace('"', "", trim($value)) . ")"; } } if (!$this->getInclude()) {