MediaWiki
REL1_24
|
Search engine hook for MySQL 4+. More...
Public Member Functions | |
delete ($id, $title) | |
Delete an indexed page Title should be pre-processed. | |
getCountQuery ($filteredTerm, $fulltext) | |
getIndexField ($fulltext) | |
Picks which field to index on, depending on what type of query. | |
getQuery ($filteredTerm, $fulltext) | |
Construct the SQL query to do the search. | |
normalizeText ($string) | |
Converts some characters for MySQL's indexing to grok it correctly, and pads short words to overcome limitations. | |
parseQuery ($filteredText, $fulltext) | |
Parse the user's query and transform it into an SQL fragment which will become part of a WHERE clause. | |
queryMain (&$query, $filteredTerm, $fulltext) | |
Get the base part of the search query. | |
queryNamespaces (&$query) | |
Add namespace conditions. | |
regexTerm ($string, $wildcard) | |
searchText ($term) | |
Perform a full text search query and return a result set. | |
searchTitle ($term) | |
Perform a title-only search query and return a result set. | |
supports ($feature) | |
update ($id, $title, $text) | |
Create or update the search index record for the given page. | |
updateTitle ($id, $title) | |
Update a search index record's title only. | |
Static Public Member Functions | |
static | legalSearchChars () |
Protected Member Functions | |
limitResult (&$query) | |
Add limit options. | |
minSearchLength () | |
Check MySQL server's ft_min_word_len setting so we know if we need to pad short words... | |
queryFeatures (&$query) | |
Add special conditions. | |
searchInternal ($term, $fulltext) | |
stripForSearchCallback ($matches) | |
Armor a case-folded UTF-8 string to get through MySQL's fulltext search without being mucked up by funny charset settings or anything else of the sort. | |
Protected Attributes | |
$strictMatching = true | |
Static Private Attributes | |
static | $mMinSearchLength |
Search engine hook for MySQL 4+.
Definition at line 31 of file SearchMySQL.php.
SearchMySQL::delete | ( | $ | id, |
$ | title | ||
) |
Delete an indexed page Title should be pre-processed.
Reimplemented from SearchEngine.
Definition at line 370 of file SearchMySQL.php.
SearchMySQL::getCountQuery | ( | $ | filteredTerm, |
$ | fulltext | ||
) |
string | $filteredTerm | |
bool | $fulltext |
Definition at line 310 of file SearchMySQL.php.
References $query, array(), parseQuery(), queryFeatures(), and queryNamespaces().
Referenced by searchInternal().
SearchMySQL::getIndexField | ( | $ | fulltext | ) |
Picks which field to index on, depending on what type of query.
bool | $fulltext |
Definition at line 281 of file SearchMySQL.php.
Referenced by parseQuery().
SearchMySQL::getQuery | ( | $ | filteredTerm, |
$ | fulltext | ||
) |
Construct the SQL query to do the search.
The guts shoulds be constructed in queryMain()
string | $filteredTerm | |
bool | $fulltext |
Definition at line 259 of file SearchMySQL.php.
References $query, array(), limitResult(), queryFeatures(), queryMain(), and queryNamespaces().
Referenced by searchInternal().
static SearchMySQL::legalSearchChars | ( | ) | [static] |
Reimplemented from SearchEngine.
Definition at line 152 of file SearchMySQL.php.
Referenced by parseQuery().
SearchMySQL::limitResult | ( | &$ | query | ) | [protected] |
Add limit options.
array | $query |
Definition at line 246 of file SearchMySQL.php.
References $query.
Referenced by getQuery().
SearchMySQL::minSearchLength | ( | ) | [protected] |
Check MySQL server's ft_min_word_len setting so we know if we need to pad short words...
Definition at line 441 of file SearchMySQL.php.
References $dbr, $mMinSearchLength, $result, and wfGetDB().
Referenced by normalizeText().
SearchMySQL::normalizeText | ( | $ | string | ) |
Converts some characters for MySQL's indexing to grok it correctly, and pads short words to overcome limitations.
string | $string |
Reimplemented from SearchEngine.
Definition at line 382 of file SearchMySQL.php.
References $n, $out, $wgContLang, array(), global, minSearchLength(), wfProfileIn(), and wfProfileOut().
Referenced by parseQuery(), update(), and updateTitle().
SearchMySQL::parseQuery | ( | $ | filteredText, |
$ | fulltext | ||
) |
Parse the user's query and transform it into an SQL fragment which will become part of a WHERE clause.
string | $filteredText | |
string | $fulltext |
Definition at line 45 of file SearchMySQL.php.
References $regexp, $term, $wgContLang, array(), as, getIndexField(), global, legalSearchChars(), list, normalizeText(), regexTerm(), wfDebug(), wfRestoreWarnings(), and wfSuppressWarnings().
Referenced by getCountQuery(), and queryMain().
SearchMySQL::queryFeatures | ( | &$ | query | ) | [protected] |
Add special conditions.
array | $query |
Definition at line 219 of file SearchMySQL.php.
References $query, $value, and as.
Referenced by getCountQuery(), and getQuery().
SearchMySQL::queryMain | ( | &$ | query, |
$ | filteredTerm, | ||
$ | fulltext | ||
) |
Get the base part of the search query.
array | &$query | Search query array |
string | $filteredTerm | |
bool | $fulltext |
Definition at line 293 of file SearchMySQL.php.
References $query, and parseQuery().
Referenced by getQuery().
SearchMySQL::queryNamespaces | ( | &$ | query | ) |
Add namespace conditions.
array | $query |
Definition at line 232 of file SearchMySQL.php.
References $query, and namespaces.
Referenced by getCountQuery(), and getQuery().
SearchMySQL::regexTerm | ( | $ | string, |
$ | wildcard | ||
) |
Definition at line 133 of file SearchMySQL.php.
References $wgContLang, and global.
Referenced by parseQuery().
SearchMySQL::searchInternal | ( | $ | term, |
$ | fulltext | ||
) | [protected] |
Definition at line 176 of file SearchMySQL.php.
References $query, $term, $total, SearchDatabase\filter(), getCountQuery(), and getQuery().
Referenced by searchText(), and searchTitle().
SearchMySQL::searchText | ( | $ | term | ) |
Perform a full text search query and return a result set.
string | $term | Raw search term |
Reimplemented from SearchEngine.
Definition at line 162 of file SearchMySQL.php.
References $term, and searchInternal().
SearchMySQL::searchTitle | ( | $ | term | ) |
Perform a title-only search query and return a result set.
string | $term | Raw search term |
Reimplemented from SearchEngine.
Definition at line 172 of file SearchMySQL.php.
References $term, and searchInternal().
SearchMySQL::stripForSearchCallback | ( | $ | matches | ) | [protected] |
Armor a case-folded UTF-8 string to get through MySQL's fulltext search without being mucked up by funny charset settings or anything else of the sort.
array | $matches |
Definition at line 431 of file SearchMySQL.php.
References $matches.
SearchMySQL::supports | ( | $ | feature | ) |
string | $feature |
Reimplemented from SearchEngine.
Definition at line 205 of file SearchMySQL.php.
SearchMySQL::update | ( | $ | id, |
$ | title, | ||
$ | text | ||
) |
Create or update the search index record for the given page.
Title and text should be pre-processed.
int | $id | |
string | $title | |
string | $text |
Reimplemented from SearchEngine.
Definition at line 335 of file SearchMySQL.php.
References $title, array(), normalizeText(), and wfGetDB().
SearchMySQL::updateTitle | ( | $ | id, |
$ | title | ||
) |
Update a search index record's title only.
Title should be pre-processed.
int | $id | |
string | $title |
Reimplemented from SearchEngine.
Definition at line 353 of file SearchMySQL.php.
References $title, array(), normalizeText(), and wfGetDB().
SearchMySQL::$mMinSearchLength [static, private] |
Definition at line 34 of file SearchMySQL.php.
Referenced by minSearchLength().
SearchMySQL::$strictMatching = true [protected] |
Definition at line 32 of file SearchMySQL.php.