Inherited by MockSearch, SearchEngineDummy, SearchIBM_DB2, SearchMySQL, SearchOracle, SearchPostgres, and SearchSqlite.
Public Member Functions | |
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. | |
acceptListRedirects () | |
If this search backend can list/unlist redirects. | |
normalizeText ($string) | |
When overridden in derived class, performs database-specific conversions on text to be used for searching or updating search index. | |
transformSearchTerm ($term) | |
Transform search term in cases when parts of the query came as different GET params (when supported) e.g. | |
setLimitOffset ($limit, $offset=0) | |
Set the maximum number of results to return and how many to skip before returning the first. | |
setNamespaces ($namespaces) | |
Set which namespaces the search should include. | |
replacePrefixes ($query) | |
Parse some common prefixes: all (search everything) or namespace names. | |
filter ($text) | |
Return a 'cleaned up' search string. | |
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 | getNearMatch ($searchterm) |
If an exact title match can be found, or a very slightly close match, return the title. | |
static | legalSearchChars () |
static | searchableNamespaces () |
Make a list of searchable namespaces and their canonical names. | |
static | userNamespaces ($user) |
Extract default namespaces to search from the given user's settings, returning a list of index numbers. | |
static | userHighlightPrefs (&$user) |
Find snippet highlight settings for a given user. | |
static | defaultNamespaces () |
An array of namespaces indexes to be searched by default. | |
static | namespacesAsText ($namespaces) |
Get a list of namespace names useful for showing in tooltips and preferences. | |
static | helpNamespaces () |
Return the help namespaces to be shown on Special:Search. | |
static | create () |
Load up the appropriate search engine class for the currently active database backend, and return a configured instance. | |
static | getOpenSearchTemplate () |
Get OpenSearch suggestion template. | |
static | getMWSuggestTemplate () |
Get internal MediaWiki Suggest template. | |
Public Attributes | |
$limit = 10 | |
$offset = 0 | |
$prefix = '' | |
$searchTerms = array() | |
$namespaces = array( NS_MAIN ) | |
$showRedirects = false | |
Static Private Member Functions | |
static | getNearMatchInternal ($searchterm) |
Really find the title match. |
Definition at line 13 of file SearchEngine.php.
SearchEngine::acceptListRedirects | ( | ) |
static SearchEngine::create | ( | ) | [static] |
Load up the appropriate search engine class for the currently active database backend, and return a configured instance.
Definition at line 365 of file SearchEngine.php.
References $dbr, $wgSearchType, and wfGetDB().
Referenced by SearchUpdate::doUpdate(), ApiQuerySearch::run(), and SpecialSearch::showResults().
static SearchEngine::defaultNamespaces | ( | ) | [static] |
An array of namespaces indexes to be searched by default.
Definition at line 315 of file SearchEngine.php.
References $wgNamespacesToBeSearchedDefault.
Referenced by getOpenSearchTemplate(), and SpecialSearch::getSearchProfiles().
SearchEngine::filter | ( | $ | text | ) |
Return a 'cleaned up' search string.
$text | String |
Definition at line 355 of file SearchEngine.php.
References legalSearchChars().
Referenced by SearchSqlite::searchInternal(), and SearchMySQL::searchInternal().
static SearchEngine::getMWSuggestTemplate | ( | ) | [static] |
Get internal MediaWiki Suggest template.
Definition at line 424 of file SearchEngine.php.
References $wgMWSuggestTemplate, $wgScriptPath, and $wgServer.
Referenced by Skin::makeGlobalVariablesScript().
static SearchEngine::getNearMatch | ( | $ | searchterm | ) | [static] |
If an exact title match can be found, or a very slightly close match, return the title.
If no match, returns NULL.
$searchterm | String |
Definition at line 77 of file SearchEngine.php.
References $title, getNearMatchInternal(), and wfRunHooks().
Referenced by getNearMatchInternal(), and SpecialSearch::goResult().
static SearchEngine::getNearMatchInternal | ( | $ | searchterm | ) | [static, private] |
Really find the title match.
Definition at line 87 of file SearchEngine.php.
References $title, $wgContLang, MediaWiki::articleFromTitle(), getNearMatch(), SpecialPage::getTitleFor(), User::isIP(), Title::makeTitle(), Title::newFromText(), wfFindFile(), and wfRunHooks().
Referenced by getNearMatch().
static SearchEngine::getOpenSearchTemplate | ( | ) | [static] |
Get OpenSearch suggestion template.
Definition at line 408 of file SearchEngine.php.
References $wgOpenSearchTemplate, $wgScriptPath, $wgServer, and defaultNamespaces().
static SearchEngine::helpNamespaces | ( | ) | [static] |
Return the help namespaces to be shown on Special:Search.
Definition at line 343 of file SearchEngine.php.
References $wgNamespacesToBeSearchedHelp.
Referenced by SpecialSearch::getSearchProfiles().
static SearchEngine::legalSearchChars | ( | ) | [static] |
Reimplemented in SearchMySQL, SearchOracle, and SearchSqlite.
Definition at line 190 of file SearchEngine.php.
Referenced by SearchUpdate::doUpdate(), filter(), Title::indexTitle(), and SearchIBM_DB2::parseQuery().
static SearchEngine::namespacesAsText | ( | $ | namespaces | ) | [static] |
Get a list of namespace names useful for showing in tooltips and preferences.
$namespaces | Array |
Definition at line 327 of file SearchEngine.php.
References $namespaces, $wgContLang, and wfMsg().
Referenced by SpecialSearch::getSearchProfiles().
SearchEngine::normalizeText | ( | $ | string | ) |
When overridden in derived class, performs database-specific conversions on text to be used for searching or updating search index.
Default implementation does nothing (simply returns $string).
$string | string: String to process |
Reimplemented in SearchMySQL.
Definition at line 58 of file SearchEngine.php.
SearchEngine::replacePrefixes | ( | $ | query | ) |
Parse some common prefixes: all (search everything) or namespace names.
$query | String |
Definition at line 222 of file SearchEngine.php.
References $prefix, $wgContLang, wfMsgForContent(), and wfRunHooks().
static SearchEngine::searchableNamespaces | ( | ) | [static] |
Make a list of searchable namespaces and their canonical names.
Definition at line 255 of file SearchEngine.php.
References $name, $wgContLang, and wfRunHooks().
Referenced by User::getDefaultOptions(), SpecialSearch::getSearchProfiles(), Preferences::loadOldSearchNs(), SpecialSearch::powerSearch(), SpecialSearch::powerSearchBox(), Preferences::searchPreferences(), SpecialSearch::setupPage(), SpecialSearch::shortDialog(), and userNamespaces().
SearchEngine::searchText | ( | $ | term | ) |
Perform a full text search query and return a result set.
If title searches are not supported or disabled, return null. STUB
$term | String: raw search term |
Reimplemented in SearchIBM_DB2, SearchMySQL, SearchOracle, SearchPostgres, and SearchSqlite.
Definition at line 29 of file SearchEngine.php.
SearchEngine::searchTitle | ( | $ | term | ) |
Perform a title-only search query and return a result set.
If title searches are not supported or disabled, return null. STUB
$term | String: raw search term |
Reimplemented in SearchIBM_DB2, SearchMySQL, SearchOracle, SearchPostgres, and SearchSqlite.
Definition at line 41 of file SearchEngine.php.
SearchEngine::setLimitOffset | ( | $ | limit, | |
$ | offset = 0 | |||
) |
Set the maximum number of results to return and how many to skip before returning the first.
$limit | Integer | |
$offset | Integer |
Definition at line 201 of file SearchEngine.php.
SearchEngine::setNamespaces | ( | $ | namespaces | ) |
Set which namespaces the search should include.
Give an array of namespace index numbers.
$namespaces | Array |
Definition at line 212 of file SearchEngine.php.
References $namespaces.
SearchEngine::transformSearchTerm | ( | $ | term | ) |
Transform search term in cases when parts of the query came as different GET params (when supported) e.g.
for prefix queries: search=test&prefix=Main_Page/Archive -> test prefix:Main Page/Archive
Definition at line 66 of file SearchEngine.php.
SearchEngine::update | ( | $ | id, | |
$ | title, | |||
$ | text | |||
) |
Create or update the search index record for the given page.
Title and text should be pre-processed. STUB
$id | Integer | |
$title | String | |
$text | String |
Reimplemented in SearchIBM_DB2, SearchMySQL, SearchOracle, SearchPostgres, SearchSqlite, and MockSearch.
Definition at line 387 of file SearchEngine.php.
SearchEngine::updateTitle | ( | $ | id, | |
$ | title | |||
) |
Update a search index record's title only.
Title should be pre-processed. STUB
$id | Integer | |
$title | String |
Reimplemented in SearchIBM_DB2, SearchMySQL, SearchOracle, SearchPostgres, and SearchSqlite.
Definition at line 399 of file SearchEngine.php.
static SearchEngine::userHighlightPrefs | ( | &$ | user | ) | [static] |
Find snippet highlight settings for a given user.
$user | User |
Definition at line 302 of file SearchEngine.php.
Referenced by SearchResult::getTextSnippet().
static SearchEngine::userNamespaces | ( | $ | user | ) | [static] |
Extract default namespaces to search from the given user's settings, returning a list of index numbers.
$user | User |
Definition at line 275 of file SearchEngine.php.
References $wgSearchEverythingOnlyLoggedIn, Preferences::loadOldSearchNs(), and searchableNamespaces().
Referenced by SpecialSearch::__construct(), and Skin::makeGlobalVariablesScript().
SearchEngine::$limit = 10 |
SearchEngine::$namespaces = array( NS_MAIN ) |
Definition at line 18 of file SearchEngine.php.
Referenced by namespacesAsText(), SearchSqlite::queryNamespaces(), SearchOracle::queryNamespaces(), SearchMySQL::queryNamespaces(), SearchIBM_DB2::queryNamespaces(), SearchPostgres::searchQuery(), and setNamespaces().
SearchEngine::$offset = 0 |
SearchEngine::$prefix = '' |
Definition at line 16 of file SearchEngine.php.
Referenced by replacePrefixes(), and SearchPostgres::searchQuery().
SearchEngine::$searchTerms = array() |
Definition at line 17 of file SearchEngine.php.
SearchEngine::$showRedirects = false |
Definition at line 19 of file SearchEngine.php.