@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Provide a setup warning about ft_min_word_len

Summary: Fixes T4130. Adds a setup warning when ft_min_word_len is set to the default value.

Test Plan: Hit setup warning; resovled setup warning. Searched for "DOS".

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T4130

Differential Revision: https://secure.phabricator.com/D10259

+49 -1
+49 -1
src/applications/config/check/PhabricatorSetupCheckMySQL.php
··· 94 94 "%s\n". 95 95 "(You can also use a different file if you prefer. The file ". 96 96 "suggested above has about 50 of the most common English words.)\n\n". 97 - "Finally, run this command:\n\n". 97 + "Finally, run this command to rebuild indexes using the new ". 98 + "rules:\n\n". 98 99 "%s", 99 100 phutil_tag('tt', array(), 'my.cnf'), 100 101 phutil_tag('tt', array(), '[mysqld]'), ··· 111 112 ->setMessage($message); 112 113 } 113 114 } 115 + 116 + 117 + $min_len = queryfx_one($conn_raw, 'SELECT @@ft_min_word_len'); 118 + $min_len = $min_len['@@ft_min_word_len']; 119 + if ($min_len == 4) { 120 + if (!PhabricatorDefaultSearchEngineSelector::shouldUseElasticSearch()) { 121 + $namespace = PhabricatorEnv::getEnvConfig('storage.default-namespace'); 122 + 123 + $summary = pht( 124 + 'MySQL is configured to only index words with at least 4 '. 125 + 'characters.'); 126 + 127 + $message = pht( 128 + "Your MySQL instance is configured to use the default minimum word ". 129 + "length when building search indexes, which is 4. This means words ". 130 + "which are only 3 characters long will not be indexed and can not ". 131 + "be searched for.\n\n". 132 + "For example, you will not be able to find search results for words ". 133 + "like 'SMS', 'web', or 'DOS'.\n\n". 134 + "You can change this setting to 3 to allow these words to be ". 135 + "indexed. Alternatively, you can ignore this warning if you are ". 136 + "not concerned about searching for 3-letter words. If you later ". 137 + "plan to configure ElasticSearch, you can also ignore this warning: ". 138 + "only MySQL fulltext search is affected.\n\n". 139 + "To reduce the minimum word length to 3, add this to your %s file ". 140 + "(in the %s section) and then restart %s:\n\n". 141 + "%s\n". 142 + "Finally, run this command to rebuild indexes using the new ". 143 + "rules:\n\n". 144 + "%s", 145 + phutil_tag('tt', array(), 'my.cnf'), 146 + phutil_tag('tt', array(), '[mysqld]'), 147 + phutil_tag('tt', array(), 'mysqld'), 148 + phutil_tag('pre', array(), 'ft_min_word_len=3'), 149 + phutil_tag( 150 + 'pre', 151 + array(), 152 + "mysql> REPAIR TABLE {$namespace}_search.search_documentfield;")); 153 + 154 + $this->newIssue('mysql.ft_min_word_len') 155 + ->setName(pht('MySQL is Using Default Minimum Word Length')) 156 + ->setSummary($summary) 157 + ->setMessage($message); 158 + } 159 + } 160 + 161 + 114 162 } 115 163 116 164 }