Go to the documentation of this file.
37 $resultSet = $this->db->resultObject( $this->db->query( $this->getQuery( $this->filter(
$term ),
true ) ) );
49 $resultSet = $this->db->resultObject( $this->db->query( $this->getQuery( $this->filter(
$term ),
false ) ) );
64 return 'AND page_namespace IN (' .
$namespaces .
')';
75 return $this->db->limitResult( $sql, $this->limit, $this->offset );
85 return ' ORDER BY ftindex.[RANK] DESC';
96 function getQuery( $filteredTerm, $fulltext ) {
109 return $fulltext ?
'si_text' :
'si_title';
121 $match = $this->
parseQuery( $filteredTerm, $fulltext );
122 $page = $this->db->tableName(
'page' );
123 $searchindex = $this->db->tableName(
'searchindex' );
125 return 'SELECT page_id, page_namespace, page_title, ftindex.[RANK]' .
126 "FROM $page,FREETEXTTABLE($searchindex , $match, LANGUAGE 'English') as ftindex " .
127 'WHERE page_id=ftindex.[KEY] ';
136 $this->searchTerms =
array();
138 # @todo FIXME: This doesn't handle parenthetical expressions.
142 if ( preg_match_all(
'/([-+<>~]?)(([' . $lc .
']+)(\*?)|"[^"]*")/',
143 $filteredText, $m, PREG_SET_ORDER ) ) {
144 foreach ( $m
as $terms ) {
145 $q[] = $terms[1] .
$wgContLang->normalizeForSearch( $terms[2] );
147 if ( !empty( $terms[3] ) ) {
148 $regexp = preg_quote( $terms[3],
'/' );
153 $regexp = preg_quote( str_replace(
'"',
'', $terms[2] ),
'/' );
155 $this->searchTerms[] =
$regexp;
159 $searchon = $this->db->strencode( join(
',', $q ) );
161 return "$field, '$searchon'";
179 $table = $this->db->tableName(
'searchindex' );
180 $utf8bom =
'0xEFBBBF';
181 $si_title = $utf8bom . bin2hex(
$title );
182 $si_text = $utf8bom . bin2hex( $text );
183 $sql =
"DELETE FROM $table WHERE si_page = $id;";
184 $sql .=
"INSERT INTO $table (si_page, si_title, si_text) VALUES ($id, $si_title, $si_text)";
185 return $this->db->query( $sql,
'SearchMssql::update' );
197 $table = $this->db->tableName(
'searchindex' );
200 $utf8bom =
'0xEFBBBF';
201 $si_title = $utf8bom . bin2hex(
$title );
202 $sql =
"DELETE FROM $table WHERE si_page = $id;";
203 $sql .=
"INSERT INTO $table (si_page, si_title, si_text) VALUES ($id, $si_title, 0x00)";
204 return $this->db->query( $sql,
'SearchMssql::updateTitle' );
213 $this->mResultSet = $resultSet;
214 $this->mTerms = $terms;
218 return $this->mTerms;
222 return $this->mResultSet->numRows();
226 $row = $this->mResultSet->fetchObject();
227 if ( $row ===
false ) {
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Search engine hook base class for Mssql (ConText).
queryLimit( $sql)
Return a LIMIT clause to limit results on the query.
queryMain( $filteredTerm, $fulltext)
Get the base part of the search query.
__construct( $resultSet, $terms)
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 content language as $wgContLang
searchTitle( $term)
Perform a title-only search query and return a result set.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return true
Base search engine base class for database-backed searches.
to move a page</td >< td > &*You are moving the page across namespaces
searchText( $term)
Perform a full text search query and return a result set.
getQuery( $filteredTerm, $fulltext)
Construct the full SQL query to do the search.
next()
Fetches next search result, or false.
updateTitle( $id, $title)
Update a search index record's title only.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
when a variable name is used in a it is silently declared as a new masking the global
processing should stop and the error should be shown to the user * false
parseQuery( $filteredText, $fulltext)
presenting them properly to the user as errors is done by the caller $title
queryRanking( $filteredTerm, $fulltext)
Does not do anything for generic search engine subclasses may define this though.
static legalSearchChars()
update( $id, $title, $text)
Create or update the search index record for the given page.
termMatches()
Fetch an array of regular expression fragments for matching the search terms as parsed by this engine...
the value to return A Title object or null whereas SearchGetNearMatch runs after $term
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
getIndexField( $fulltext)
Picks which field to index on, depending on what type of query.
queryNamespaces()
Return a partial WHERE clause to limit the search to the given namespaces.