BlueSpice MediaWiki REL1_27
 All Classes Namespaces Files Functions Variables Groups Pages
PrefixSearch Class Reference
Inheritance diagram for PrefixSearch:

Public Member Functions

 search ($search, $limit, $namespaces=[], $offset=0)
 
 searchWithVariants ($search, $limit, array $namespaces, $offset=0)
 
 defaultSearchBackend ($namespaces, $search, $limit, $offset)
 

Static Public Member Functions

static titleSearch ($search, $limit, $namespaces=[], $offset=0)
 

Protected Member Functions

 titles (array $titles)
 
 strings (array $strings)
 
 searchBackend ($namespaces, $search, $limit, $offset)
 
 specialSearch ($search, $limit, $offset)
 
 validateNamespaces ($namespaces)
 

Detailed Description

Handles searching prefixes of titles and finding any page names that match. Used largely by the OpenSearch implementation.

Deprecated:
Since 1.27, Use SearchEngine::prefixSearchSubpages or SearchEngine::completionSearch

Member Function Documentation

PrefixSearch::defaultSearchBackend (   $namespaces,
  $search,
  $limit,
  $offset 
)

Unless overridden by PrefixSearchBackend hook... This is case-sensitive (First character may be automatically capitalized by Title::secureAndSpit() later on depending on $wgCapitalLinks)

Parameters
array$namespacesNamespaces to search in
string$searchTerm
int$limitMax number of items to return
int$offsetNumber of items to skip
Returns
array Array of Title objects
PrefixSearch::search (   $search,
  $limit,
  $namespaces = [],
  $offset = 0 
)

Do a prefix search of titles and return a list of matching page names.

Parameters
string$search
int$limit
array$namespacesUsed if query is not explicitly prefixed
int$offsetHow many results to offset from the beginning
Returns
array Array of strings or Title objects
PrefixSearch::searchBackend (   $namespaces,
  $search,
  $limit,
  $offset 
)
protected

Do a prefix search of titles and return a list of matching page names.

Parameters
array$namespaces
string$search
int$limit
int$offsetHow many results to offset from the beginning
Returns
array Array of strings
PrefixSearch::searchWithVariants (   $search,
  $limit,
array  $namespaces,
  $offset = 0 
)

Do a prefix search for all possible variants of the prefix

Parameters
string$search
int$limit
array$namespaces
int$offsetHow many results to offset from the beginning
Returns
array
PrefixSearch::specialSearch (   $search,
  $limit,
  $offset 
)
protected

Prefix search special-case for Special: namespace.

Parameters
string$searchTerm
int$limitMax number of items to return
int$offsetNumber of items to offset
Returns
array
PrefixSearch::strings ( array  $strings)
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.

Parameters
array$strings
Returns
array
PrefixSearch::titles ( array  $titles)
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.

Parameters
array$titles
Returns
array
static PrefixSearch::titleSearch (   $search,
  $limit,
  $namespaces = [],
  $offset = 0 
)
static

Do a prefix search of titles and return a list of matching page names.

Deprecated:
Since 1.23, use TitlePrefixSearch or StringPrefixSearch classes
Parameters
string$search
int$limit
array$namespacesUsed if query is not explicitly prefixed
int$offsetHow many results to offset from the beginning
Returns
array Array of strings
PrefixSearch::validateNamespaces (   $namespaces)
protected

Validate an array of numerical namespace indexes

Parameters
array$namespaces
Returns
array (default: contains only NS_MAIN)

The documentation for this class was generated from the following file: