diff --git a/src/applications/config/check/PhabricatorSetupCheckMySQL.php b/src/applications/config/check/PhabricatorSetupCheckMySQL.php index 9ea3ca6f6d..16a5438cee 100644 --- a/src/applications/config/check/PhabricatorSetupCheckMySQL.php +++ b/src/applications/config/check/PhabricatorSetupCheckMySQL.php @@ -226,6 +226,41 @@ final class PhabricatorSetupCheckMySQL extends PhabricatorSetupCheck { } } + $bool_syntax = self::loadRawConfigValue('ft_boolean_syntax'); + if ($bool_syntax != ' |-><()~*:""&^') { + if (!PhabricatorDefaultSearchEngineSelector::shouldUseElasticSearch()) { + + $summary = pht( + 'MySQL is configured to search on fulltext indexes using "OR" by '. + 'default. Using "AND" is usually the desired behaviour.'); + + $message = pht( + "Your MySQL instance is configured to use the default Boolean ". + "search syntax when using fulltext indexes. This means searching ". + "for 'search words' will yield the query 'search OR words' ". + "instead of the desired 'search AND words'.\n\n". + "This might produce unexpected search results. \n\n". + "You can change this setting to a more sensible default. ". + "Alternatively, you can ignore this warning if ". + "using 'OR' is the desired behaviour. If you later plan ". + "to configure ElasticSearch, you can also ignore this warning: ". + "only MySQL fulltext search is affected.\n\n". + "To change this setting, add this to your %s file ". + "(in the %s section) and then restart %s:\n\n". + "%s\n", + phutil_tag('tt', array(), 'my.cnf'), + phutil_tag('tt', array(), '[mysqld]'), + phutil_tag('tt', array(), 'mysqld'), + phutil_tag('pre', array(), 'ft_boolean_syntax=\' |-><()~*:""&^\'')); + + $this->newIssue('mysql.ft_boolean_syntax') + ->setName(pht('MySQL is Using the Default Boolean Syntax')) + ->setSummary($summary) + ->setMessage($message) + ->addMySQLConfig('ft_boolean_syntax'); + } + } + $innodb_pool = self::loadRawConfigValue('innodb_buffer_pool_size'); $innodb_bytes = phutil_parse_bytes($innodb_pool); $innodb_readable = phutil_format_bytes($innodb_bytes);