MediaWiki
1.23.5
|
Handles searching prefixes of titles and finding any page names that match. More...
Public Member Functions | |
search ( $search, $limit, $namespaces=array()) | |
Do a prefix search of titles and return a list of matching page names. More... | |
searchWithVariants ( $search, $limit, array $namespaces) | |
Do a prefix search for all possible variants of the prefix. More... | |
Static Public Member Functions | |
static | titleSearch ( $search, $limit, $namespaces=array()) |
Do a prefix search of titles and return a list of matching page names. More... | |
Protected Member Functions | |
defaultSearchBackend ( $namespaces, $search, $limit) | |
Unless overridden by PrefixSearchBackend hook... More... | |
searchBackend ( $namespaces, $search, $limit) | |
Do a prefix search of titles and return a list of matching page names. More... | |
specialSearch ( $search, $limit) | |
Prefix search special-case for Special: namespace. More... | |
strings (array $strings) | |
When implemented in a descendant class, receives an array of titles as strings and returns either an unmodified array or an array of Title objects corresponding to strings received. More... | |
titles (array $titles) | |
When implemented in a descendant class, receives an array of Title objects and returns either an unmodified array or an array of strings corresponding to titles passed to it. More... | |
validateNamespaces ( $namespaces) | |
Validate an array of numerical namespace indexes. More... | |
Handles searching prefixes of titles and finding any page names that match.
Used largely by the OpenSearch implementation.
Definition at line 29 of file PrefixSearch.php.
|
protected |
Unless overridden by PrefixSearchBackend hook...
This is case-sensitive (First character may be automatically capitalized by Title::secureAndSpit() later on depending on $wgCapitalLinks)
array | $namespaces | namespaces to search in |
string | $search | term |
$limit | Integer: max number of items to return |
Definition at line 221 of file PrefixSearch.php.
References $dbr, $limit, $namespaces, $res, $t, array(), as, DB_SLAVE, Title\newFromRow(), Title\newFromText(), NS_MAIN, and wfGetDB().
Referenced by searchBackend().
PrefixSearch::search | ( | $search, | |
$limit, | |||
$namespaces = array() |
|||
) |
Do a prefix search of titles and return a list of matching page names.
$search | String | |
$limit | Integer | |
array | $namespaces | used if query is not explicitly prefixed |
Definition at line 52 of file PrefixSearch.php.
References $limit, $namespaces, $title, array(), Title\newFromText(), NS_MAIN, searchBackend(), and validateNamespaces().
Referenced by searchWithVariants(), and titleSearch().
|
protected |
Do a prefix search of titles and return a list of matching page names.
$namespaces | Array |
$search | String |
$limit | Integer |
Definition at line 143 of file PrefixSearch.php.
References $limit, $namespaces, array(), defaultSearchBackend(), NS_FILE, NS_MEDIA, NS_SPECIAL, specialSearch(), strings(), titles(), and wfRunHooks().
Referenced by search().
PrefixSearch::searchWithVariants | ( | $search, | |
$limit, | |||
array | $namespaces | ||
) |
Do a prefix search for all possible variants of the prefix.
$search | String | |
$limit | Integer | |
array | $namespaces |
Definition at line 91 of file PrefixSearch.php.
References $limit, $namespaces, $wgContLang, array(), as, global, search(), wfProfileIn(), and wfProfileOut().
Referenced by ApiOpenSearch\execute().
|
protected |
Prefix search special-case for Special: namespace.
string | $search | term |
$limit | Integer: max number of items to return |
Definition at line 166 of file PrefixSearch.php.
References $keys, $limit, $wgContLang, array(), as, SpecialPageFactory\getList(), global, Title\makeTitleSafe(), and NS_SPECIAL.
Referenced by searchBackend().
|
abstractprotected |
When implemented in a descendant class, receives an array of titles as strings and returns either an unmodified array or an array of Title objects corresponding to strings received.
array | $strings |
Reimplemented in StringPrefixSearch, and TitlePrefixSearch.
Referenced by searchBackend().
|
abstractprotected |
When implemented in a descendant class, receives an array of Title objects and returns either an unmodified array or an array of strings corresponding to titles passed to it.
array | $titles |
Reimplemented in StringPrefixSearch, and TitlePrefixSearch.
Referenced by searchBackend().
|
static |
Do a prefix search of titles and return a list of matching page names.
$search | String | |
$limit | Integer | |
array | $namespaces | used if query is not explicitly prefixed |
Definition at line 39 of file PrefixSearch.php.
References $limit, $namespaces, and search().
|
protected |
Validate an array of numerical namespace indexes.
$namespaces | Array |
Definition at line 252 of file PrefixSearch.php.
References $namespaces, $wgContLang, array(), as, global, and NS_MAIN.
Referenced by search().