diff --git a/search_api_db/src/Plugin/search_api/backend/Database.php b/search_api_db/src/Plugin/search_api/backend/Database.php index 0e761ee..cc91584 100644 --- a/search_api_db/src/Plugin/search_api/backend/Database.php +++ b/search_api_db/src/Plugin/search_api/backend/Database.php @@ -1813,7 +1813,7 @@ protected function createKeysQuery($keys, array $fields, array $all_fields, Inde // All text fields in the index share a table. Get name from the first. $field = reset($fields); $db_query = $this->database->select($field['table'], 't'); - $mul_words = $word_count > 1; + $mul_words = ($word_count > 1); if ($neg_nested) { $db_query->fields('t', array('item_id', 'word')); } @@ -1910,7 +1910,7 @@ protected function createKeysQuery($keys, array $fields, array $all_fields, Inde } if (!$match_parts) { if ($mul_words) { - $db_query->having('COUNT(DISTINCT t.word) >= ' . $var, array($var => $subs)); + $db_query->having('COUNT(DISTINCT t.word) >= ' . $var, array($var => $subs)); } else { $db_query->having('COUNT(t.word) >= ' . $var, array($var => $subs)); diff --git a/search_api_db/tests/src/Kernel/BackendTest.php b/search_api_db/tests/src/Kernel/BackendTest.php index 4b56364..cd8c014 100644 --- a/search_api_db/tests/src/Kernel/BackendTest.php +++ b/search_api_db/tests/src/Kernel/BackendTest.php @@ -237,9 +237,9 @@ protected function disableHtmlFilter() { * * @param string|array|null $keys * (optional) The search keys to set, if any. - * @param array $conditions + * @param string[] $conditions * (optional) Conditions to set on the query, in the format "field,value". - * @param array|null $fields + * @param string[]|null $fields * (optional) Fulltext fields to search for the keys. * * @return \Drupal\search_api\Query\QueryInterface