function parseQuery( $filteredText, $fulltext ) {
global $wgContLang;
- $lc = $this->legalSearchChars(); // Minus format chars
+ $lc = $this->legalSearchChars( self::CHARS_NO_SYNTAX ); // Minus syntax chars (" and *)
$searchon = '';
$this->searchTerms = [];
return $regex;
}
- public static function legalSearchChars() {
- return "\"*" . parent::legalSearchChars();
+ public static function legalSearchChars( $type = self::CHARS_ALL ) {
+ $searchChars = parent::legalSearchChars( $type );
+ if ( $type === self::CHARS_ALL ) {
+ // " for phrase, * for wildcard
+ $searchChars = "\"*" . $searchChars;
+ }
+ return $searchChars;
}
/**
if ( is_null( self::$mMinSearchLength ) ) {
$sql = "SHOW GLOBAL VARIABLES LIKE 'ft\\_min\\_word\\_len'";
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
$result = $dbr->query( $sql, __METHOD__ );
$row = $result->fetchObject();
$result->free();