From: Tim Düsterhus Date: Fri, 5 Feb 2021 14:55:06 +0000 (+0100) Subject: Update MysqlSearchEngine::getFulltextMinimumWordLength() for InnoDB X-Git-Tag: 5.4.0_Alpha_1~302 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=21a3f16d9461188f06cb13624038684226bc32c1;p=GitHub%2FWoltLab%2FWCF.git Update MysqlSearchEngine::getFulltextMinimumWordLength() for InnoDB At the same time copy over the deprecation comment from AbstractSearchEngine. see 7d059540531e82c12b0aec2ad50e38a6788657cc Resolves #3948 --- diff --git a/wcfsetup/install/files/lib/system/search/mysql/MysqlSearchEngine.class.php b/wcfsetup/install/files/lib/system/search/mysql/MysqlSearchEngine.class.php index 2d66c00ec0..0c292b5b18 100644 --- a/wcfsetup/install/files/lib/system/search/mysql/MysqlSearchEngine.class.php +++ b/wcfsetup/install/files/lib/system/search/mysql/MysqlSearchEngine.class.php @@ -22,8 +22,7 @@ use wcf\util\StringUtil; class MysqlSearchEngine extends AbstractSearchEngine { /** - * MySQL's minimum word length for fulltext indices - * @var int + * @deprecated 5.4 - This property is used for the deprecated getFulltextMinimumWordLength(). */ protected $ftMinWordLen; @@ -457,12 +456,12 @@ class MysqlSearchEngine extends AbstractSearchEngine } /** - * @inheritDoc + * @deprecated 5.4 - This method was required for use in parseSearchQuery(). */ protected function getFulltextMinimumWordLength() { if ($this->ftMinWordLen === null) { - $sql = "SHOW VARIABLES LIKE 'ft_min_word_len'"; + $sql = "SHOW VARIABLES LIKE 'innodb_ft_min_token_size'"; try { $statement = WCF::getDB()->prepareStatement($sql); @@ -470,7 +469,7 @@ class MysqlSearchEngine extends AbstractSearchEngine $row = $statement->fetchArray(); } catch (DatabaseException $e) { // fallback if user is disallowed to issue 'SHOW VARIABLES' - $row = ['Value' => 4]; + $row = ['Value' => 3]; } $this->ftMinWordLen = $row['Value'];