diff --git a/includes/SearchApiAcquiaSearchService.php b/includes/SearchApiAcquiaSearchService.php
index b6afb15..f5f9895 100644
--- a/includes/SearchApiAcquiaSearchService.php
+++ b/includes/SearchApiAcquiaSearchService.php
@@ -233,7 +233,7 @@ class SearchApiAcquiaSearchService extends SearchApiSolrService {
     // Set the qt to eDisMax if we have keywords and either the configuration
     // is set to always use eDisMax or the keys contain a wildcard (* or ?).
     $keys = $query->getOriginalKeys();
-    if ($keys && (($wildcard = preg_match('/\S+[*?]/', $keys)) || $this->options['edismax'])) {
+    if ($keys && is_scalar($keys) && (($wildcard = preg_match('/\S+[*?]/', $keys)) || $this->options['edismax'])) {
       $params['defType'] = 'edismax';
       if ($wildcard) {
         // Converts keys to lower case, reset keys in query and replaces param.
