Inherits SearchEngine.
Inherited by SearchMySQL4.
Public Member Functions | |
__construct ($db) | |
parseQuery ($filteredText, $fulltext) | |
Parse the user's query and transform it into an SQL fragment which will become part of a WHERE clause. | |
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. | |
queryRedirect () | |
Return a partial WHERE clause to exclude redirects, if so set. | |
queryNamespaces () | |
Return a partial WHERE clause to limit the search to the given namespaces. | |
queryLimit () | |
Return a LIMIT clause to limit results on the query. | |
queryRanking ($filteredTerm, $fulltext) | |
Does not do anything for generic search engine subclasses may define this though. | |
getQuery ($filteredTerm, $fulltext) | |
Construct the full SQL query to do the search. | |
getIndexField ($fulltext) | |
Picks which field to index on, depending on what type of query. | |
queryMain ($filteredTerm, $fulltext) | |
Get the base part of the search query. | |
getCountQuery ($filteredTerm, $fulltext) | |
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. | |
normalizeText ($string) | |
Converts some characters for MySQL's indexing to grok it correctly, and pads short words to overcome limitations. | |
Static Public Member Functions | |
static | legalSearchChars () |
Public Attributes | |
$strictMatching = true | |
Static Public Attributes | |
static | $mMinSearchLength |
Protected Member Functions | |
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. | |
minSearchLength () | |
Check MySQL server's ft_min_word_len setting so we know if we need to pad short words. |
Definition at line 29 of file SearchMySQL.php.
SearchMySQL::__construct | ( | $ | db | ) |
SearchMySQL::getCountQuery | ( | $ | filteredTerm, | |
$ | fulltext | |||
) |
Definition at line 272 of file SearchMySQL.php.
References $page, parseQuery(), queryNamespaces(), and queryRedirect().
Referenced by searchInternal().
SearchMySQL::getIndexField | ( | $ | fulltext | ) |
Picks which field to index on, depending on what type of query.
$fulltext | Boolean |
Definition at line 249 of file SearchMySQL.php.
Referenced by parseQuery().
SearchMySQL::getQuery | ( | $ | filteredTerm, | |
$ | fulltext | |||
) |
Construct the full SQL query to do the search.
The guts shoulds be constructed in queryMain()
$filteredTerm | String | |
$fulltext | Boolean |
Definition at line 236 of file SearchMySQL.php.
References queryLimit(), queryMain(), queryNamespaces(), queryRanking(), and queryRedirect().
Referenced by searchInternal().
static SearchMySQL::legalSearchChars | ( | ) | [static] |
Reimplemented from SearchEngine.
Definition at line 142 of file SearchMySQL.php.
Referenced by parseQuery().
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 381 of file SearchMySQL.php.
References $dbr, $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.
Reimplemented from SearchEngine.
Definition at line 323 of file SearchMySQL.php.
References $n, $out, $wgContLang, 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.
Definition at line 42 of file SearchMySQL.php.
References $wgContLang, getIndexField(), legalSearchChars(), normalizeText(), regexTerm(), and wfDebug().
Referenced by getCountQuery(), and queryMain().
SearchMySQL::queryLimit | ( | ) |
Return a LIMIT clause to limit results on the query.
Definition at line 217 of file SearchMySQL.php.
Referenced by getQuery().
SearchMySQL::queryMain | ( | $ | filteredTerm, | |
$ | fulltext | |||
) |
Get the base part of the search query.
The actual match syntax will depend on the server version; MySQL 3 and MySQL 4 have different capabilities in their fulltext search indexes.
$filteredTerm | String | |
$fulltext | Boolean |
Definition at line 263 of file SearchMySQL.php.
References $page, and parseQuery().
Referenced by getQuery().
SearchMySQL::queryNamespaces | ( | ) |
Return a partial WHERE clause to limit the search to the given namespaces.
Definition at line 202 of file SearchMySQL.php.
References SearchEngine::$namespaces.
Referenced by getCountQuery(), and getQuery().
SearchMySQL::queryRanking | ( | $ | filteredTerm, | |
$ | fulltext | |||
) |
Does not do anything for generic search engine subclasses may define this though.
Definition at line 226 of file SearchMySQL.php.
Referenced by getQuery().
SearchMySQL::queryRedirect | ( | ) |
Return a partial WHERE clause to exclude redirects, if so set.
Definition at line 190 of file SearchMySQL.php.
Referenced by getCountQuery(), and getQuery().
SearchMySQL::regexTerm | ( | $ | string, | |
$ | wildcard | |||
) |
SearchMySQL::searchInternal | ( | $ | term, | |
$ | fulltext | |||
) | [protected] |
Definition at line 166 of file SearchMySQL.php.
References $total, $wgCountTotalSearchHits, SearchEngine::filter(), getCountQuery(), and getQuery().
Referenced by searchText(), and searchTitle().
SearchMySQL::searchText | ( | $ | term | ) |
Perform a full text search query and return a result set.
$term | String: raw search term |
Reimplemented from SearchEngine.
Definition at line 152 of file SearchMySQL.php.
References searchInternal().
SearchMySQL::searchTitle | ( | $ | term | ) |
Perform a title-only search query and return a result set.
$term | String: raw search term |
Reimplemented from SearchEngine.
Definition at line 162 of file SearchMySQL.php.
References 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.
Definition at line 371 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.
$id | Integer | |
$title | String | |
$text | String |
Reimplemented from SearchEngine.
Definition at line 291 of file SearchMySQL.php.
References $dbw, $title, normalizeText(), and wfGetDB().
SearchMySQL::updateTitle | ( | $ | id, | |
$ | title | |||
) |
Update a search index record's title only.
Title should be pre-processed.
$id | Integer | |
$title | String |
Reimplemented from SearchEngine.
Definition at line 309 of file SearchMySQL.php.
References $dbw, $title, normalizeText(), and wfGetDB().
SearchMySQL::$mMinSearchLength [static] |
Definition at line 31 of file SearchMySQL.php.
SearchMySQL::$strictMatching = true |
Definition at line 30 of file SearchMySQL.php.