Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15420961
D16946.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D16946.diff
View Options
diff --git a/src/applications/search/storage/document/PhabricatorSearchDocument.php b/src/applications/search/storage/document/PhabricatorSearchDocument.php
--- a/src/applications/search/storage/document/PhabricatorSearchDocument.php
+++ b/src/applications/search/storage/document/PhabricatorSearchDocument.php
@@ -40,15 +40,15 @@
}
public static function newQueryCompiler() {
- $table = new self();
- $conn = $table->establishConnection('r');
-
$compiler = new PhutilSearchQueryCompiler();
if (self::isInnoDBFulltextEngineAvailable()) {
// The InnoDB fulltext boolean operators are always the same as the
// default MyISAM operators, so we do not need to adjust the compiler.
} else {
+ $table = new self();
+ $conn = $table->establishConnection('r');
+
$operators = queryfx_one(
$conn,
'SELECT @@ft_boolean_syntax AS syntax');
@@ -61,8 +61,25 @@
}
public static function isInnoDBFulltextEngineAvailable() {
- // For now, never consider this engine to be available.
- return false;
+ static $available;
+
+ if ($available === null) {
+ $table = new self();
+ $conn = $table->establishConnection('r');
+
+ // If this system variable exists, we can use InnoDB fulltext. If it
+ // does not, this query will throw and we're stuck with MyISAM.
+ try {
+ queryfx_one(
+ $conn,
+ 'SELECT @@innodb_ft_max_token_size');
+ $available = true;
+ } catch (AphrontQueryException $x) {
+ $available = false;
+ }
+ }
+
+ return $available;
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 22, 7:34 PM (3 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7704960
Default Alt Text
D16946.diff (1 KB)
Attached To
Mode
D16946: If InnoDB FULLTEXT is available, use it for for fulltext indexes
Attached
Detach File
Event Timeline
Log In to Comment