64 return 'AND page_namespace IN (' .
$namespaces .
')';
75 return $this->db->limitResult( $sql, $this->limit, $this->offset );
87 return ' ORDER BY ftindex.[RANK] DESC';
98 function getQuery( $filteredTerm, $fulltext ) {
101 $this->
queryRanking( $filteredTerm, $fulltext ) .
' ' );
111 return $fulltext ?
'si_text' :
'si_title';
123 $match = $this->
parseQuery( $filteredTerm, $fulltext );
124 $page = $this->db->tableName(
'page' );
125 $searchindex = $this->db->tableName(
'searchindex' );
127 return 'SELECT page_id, page_namespace, page_title, ftindex.[RANK]' .
128 "FROM $page,FREETEXTTABLE($searchindex , $match, LANGUAGE 'English') as ftindex " .
129 'WHERE page_id=ftindex.[KEY] ';
140 $this->searchTerms = [];
142 # @todo FIXME: This doesn't handle parenthetical expressions.
146 if ( preg_match_all(
'/([-+<>~]?)(([' . $lc .
']+)(\*?)|"[^"]*")/',
147 $filteredText, $m, PREG_SET_ORDER ) ) {
148 foreach ( $m
as $terms ) {
149 $q[] = $terms[1] . $wgContLang->normalizeForSearch( $terms[2] );
151 if ( !empty( $terms[3] ) ) {
152 $regexp = preg_quote( $terms[3],
'/' );
154 $regexp .=
"[0-9A-Za-z_]+";
157 $regexp = preg_quote( str_replace(
'"',
'', $terms[2] ),
'/' );
159 $this->searchTerms[] = $regexp;
163 $searchon = $this->db->addQuotes( implode(
',', $q ) );
165 return "$field, $searchon";
183 $table = $this->db->tableName(
'searchindex' );
184 $utf8bom =
'0xEFBBBF';
185 $si_title = $utf8bom . bin2hex(
$title );
186 $si_text = $utf8bom . bin2hex( $text );
187 $sql =
"DELETE FROM $table WHERE si_page = $id;";
188 $sql .=
"INSERT INTO $table (si_page, si_title, si_text) VALUES ($id, $si_title, $si_text)";
189 return $this->db->query( $sql,
'SearchMssql::update' );
201 $table = $this->db->tableName(
'searchindex' );
204 $utf8bom =
'0xEFBBBF';
205 $si_title = $utf8bom . bin2hex(
$title );
206 $sql =
"DELETE FROM $table WHERE si_page = $id;";
207 $sql .=
"INSERT INTO $table (si_page, si_title, si_text) VALUES ($id, $si_title, 0x00)";
208 return $this->db->query( $sql,
'SearchMssql::updateTitle' );
external whereas SearchGetNearMatch runs after $term
to move a page</td >< td > &*You are moving the page across namespaces
static legalSearchChars($type=self::CHARS_ALL)
Get chars legal for search NOTE: usage as static is deprecated and preserved only as BC measure...
getQuery($filteredTerm, $fulltext)
Construct the full SQL query to do the search.
queryMain($filteredTerm, $fulltext)
Get the base part of the search query.
when a variable name is used in a it is silently declared as a new local masking the global
queryRanking($filteredTerm, $fulltext)
Does not do anything for generic search engine subclasses may define this though. ...
Search engine hook base class for Mssql (ConText).
update($id, $title, $text)
Create or update the search index record for the given page.
getIndexField($fulltext)
Picks which field to index on, depending on what type of query.
searchText($term)
Perform a full text search query and return a result set.
This class is used for different SQL-based search engines shipped with MediaWiki. ...
namespace and then decline to actually register it file or subcat img or subcat $title
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
parseQuery($filteredText, $fulltext)
searchTitle($term)
Perform a title-only search query and return a result set.
queryLimit($sql)
Return a LIMIT clause to limit results on the query.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
queryNamespaces()
Return a partial WHERE clause to limit the search to the given namespaces.
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the local content language as $wgContLang
Base search engine base class for database-backed searches.
updateTitle($id, $title)
Update a search index record's title only.
filter($text)
Return a 'cleaned up' search string.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached $page