Inherited by SearchEngineDummy, SearchIBM_DB2, SearchMySQL, SearchOracle, and SearchPostgres.
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. | |
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 find, 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 | projectNamespaces () |
An array of "project" namespaces indexes typically searched by logged-in users. | |
static | defaultAndProjectNamespaces () |
An array of "project" namespaces indexes typically searched by logged-in users in addition to the default namespaces. | |
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 |
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 345 of file SearchEngine.php.
References $dbr, $wgSearchType, and wfGetDB().
Referenced by SearchUpdate::doUpdate(), ApiQuerySearch::run(), SpecialSearchOld::showResults(), and SpecialSearch::showResults().
static SearchEngine::defaultAndProjectNamespaces | ( | ) | [static] |
An array of "project" namespaces indexes typically searched by logged-in users in addition to the default namespaces.
Definition at line 322 of file SearchEngine.php.
References $wgNamespacesToBeSearchedDefault, and $wgNamespacesToBeSearchedProject.
static SearchEngine::defaultNamespaces | ( | ) | [static] |
An array of namespaces indexes to be searched by default.
Definition at line 279 of file SearchEngine.php.
References $wgNamespacesToBeSearchedDefault.
Referenced by SpecialSearch::formHeader(), getOpenSearchTemplate(), and SpecialSearch::setupPage().
SearchEngine::filter | ( | $ | text | ) |
Return a 'cleaned up' search string.
Definition at line 335 of file SearchEngine.php.
References $text, and legalSearchChars().
static SearchEngine::getMWSuggestTemplate | ( | ) | [static] |
Get internal MediaWiki Suggest template.
Definition at line 406 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 find, or a very slightly close match, return the title.
If no match, returns NULL.
string | $term |
Definition at line 67 of file SearchEngine.php.
References $title, $wgContLang, MediaWiki::articleFromTitle(), SpecialPage::getTitleFor(), User::isIP(), Title::makeTitle(), Title::newFromText(), wfFindFile(), and wfRunHooks().
Referenced by SpecialSearchOld::goResult(), and SpecialSearch::goResult().
static SearchEngine::getOpenSearchTemplate | ( | ) | [static] |
Get OpenSearch suggestion template.
Definition at line 389 of file SearchEngine.php.
References $ns, $wgOpenSearchTemplate, $wgScriptPath, $wgServer, and defaultNamespaces().
static SearchEngine::legalSearchChars | ( | ) | [static] |
Reimplemented in SearchMySQL.
Definition at line 166 of file SearchEngine.php.
Referenced by SearchUpdate::doUpdate(), filter(), Title::indexTitle(), SearchOracle::parseQuery(), and SearchIBM_DB2::parseQuery().
static SearchEngine::namespacesAsText | ( | $ | namespaces | ) | [static] |
Get a list of namespace names useful for showing in tooltips and preferences.
unknown_type | $namespaces |
Definition at line 291 of file SearchEngine.php.
References $key, $namespaces, $ns, $wgContLang, and wfMsg().
Referenced by SpecialSearch::formHeader().
static SearchEngine::projectNamespaces | ( | ) | [static] |
An array of "project" namespaces indexes typically searched by logged-in users.
Definition at line 309 of file SearchEngine.php.
References $wgNamespacesToBeSearchedDefault, and $wgNamespacesToBeSearchedProject.
Referenced by SpecialSearch::formHeader(), and SpecialSearch::setupPage().
SearchEngine::replacePrefixes | ( | $ | query | ) |
Parse some common prefixes: all (search everything) or namespace names.
string | $query |
Definition at line 200 of file SearchEngine.php.
References $prefix, $wgContLang, and wfMsgForContent().
static SearchEngine::searchableNamespaces | ( | ) | [static] |
Make a list of searchable namespaces and their canonical names.
Definition at line 229 of file SearchEngine.php.
References $name, $ns, and $wgContLang.
Referenced by SpecialSearch::formHeader(), SpecialSearchOld::powerSearch(), SpecialSearch::powerSearch(), SpecialSearchOld::powerSearchBox(), SpecialSearch::powerSearchBox(), SpecialSearch::setupPage(), SpecialSearchOld::shortDialog(), 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.
string | $term - Raw search term |
Reimplemented in SearchIBM_DB2, SearchMySQL, SearchOracle, and SearchPostgres.
Definition at line 30 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.
string | $term - Raw search term |
Reimplemented in SearchIBM_DB2, SearchMySQL, SearchOracle, and SearchPostgres.
Definition at line 43 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.
int | $limit | |
int | $offset |
Definition at line 178 of file SearchEngine.php.
SearchEngine::setNamespaces | ( | $ | namespaces | ) |
Set which namespaces the search should include.
Give an array of namespace index numbers.
array | $namespaces |
Definition at line 190 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 56 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.
int | $id | |
string | $title | |
string | $text |
Reimplemented in SearchIBM_DB2, SearchMySQL, SearchOracle, and SearchPostgres.
Definition at line 367 of file SearchEngine.php.
SearchEngine::updateTitle | ( | $ | id, | |
$ | title | |||
) |
Update a search index record's title only.
Title should be pre-processed.
int | $id | |
string | $title |
Reimplemented in SearchIBM_DB2, SearchMySQL, SearchOracle, and SearchPostgres.
Definition at line 379 of file SearchEngine.php.
static SearchEngine::userHighlightPrefs | ( | &$ | user | ) | [static] |
Find snippet highlight settings for a given user.
User | $user |
Definition at line 265 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 248 of file SearchEngine.php.
References $name, $ns, $user, and searchableNamespaces().
Referenced by SpecialSearchOld::__construct(), SpecialSearch::__construct(), and Skin::makeGlobalVariablesScript().
SearchEngine::$limit = 10 |
SearchEngine::$namespaces = array( NS_MAIN ) |
Definition at line 18 of file SearchEngine.php.
Referenced by namespacesAsText(), 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.