Go to the documentation of this file.
73 $resultSet = $this->db->resultObject( $this->db->query( $this->getQuery( $this->filter(
$term ),
true ) ) );
88 $resultSet = $this->db->resultObject( $this->db->query( $this->getQuery( $this->filter(
$term ),
false ) ) );
105 return 'AND page_namespace IN (' .
$namespaces .
')';
116 return $this->db->limitResult( $sql, $this->limit, $this->offset );
126 return ' ORDER BY score(1)';
139 $this->
queryRanking( $filteredTerm, $fulltext ) .
' ' );
148 return $fulltext ?
'si_text' :
'si_title';
159 $match = $this->
parseQuery( $filteredTerm, $fulltext );
160 $page = $this->db->tableName(
'page' );
161 $searchindex = $this->db->tableName(
'searchindex' );
162 return 'SELECT page_id, page_namespace, page_title ' .
163 "FROM $page,$searchindex " .
164 'WHERE page_id=si_page AND ' . $match;
175 $this->searchTerms =
array();
177 # @todo FIXME: This doesn't handle parenthetical expressions.
180 if ( preg_match_all(
'/([-+<>~]?)(([' . $lc .
']+)(\*?)|"[^"]*")/',
181 $filteredText, $m, PREG_SET_ORDER ) ) {
182 foreach ( $m
as $terms ) {
185 $temp_terms =
$wgContLang->autoConvertToAllVariants( $terms[2] );
186 if ( is_array( $temp_terms ) ) {
187 $temp_terms = array_unique( array_values( $temp_terms ) );
188 foreach ( $temp_terms
as $t ) {
189 $searchon .= ( $terms[1] ==
'-' ?
' ~' :
' & ' ) . $this->
escapeTerm( $t );
193 $searchon .= ( $terms[1] ==
'-' ?
' ~' :
' & ' ) . $this->
escapeTerm( $terms[2] );
195 if ( !empty( $terms[3] ) ) {
196 $regexp = preg_quote( $terms[3],
'/' );
201 $regexp = preg_quote( str_replace(
'"',
'', $terms[2] ),
'/' );
203 $this->searchTerms[] =
$regexp;
207 $searchon = $this->db->addQuotes( ltrim( $searchon,
' &' ) );
209 return " CONTAINS($field, $searchon, 1) > 0 ";
215 $t = isset( $this->reservedWords[strtoupper(
$t )] ) ?
'{' .
$t .
'}' :
$t;
216 $t = preg_replace(
'/^"(.*)"$/',
'($1)',
$t );
217 $t = preg_replace(
'/([-&|])/',
'\\\\$1',
$t );
231 $dbw->replace(
'searchindex',
237 ),
'SearchOracle::update' );
244 $dbw->query(
"CALL ctx_ddl.sync_index(" .
245 $dbw->addQuotes( $dbw->getDBname() .
'.' . $dbw->tableName(
'si_text_idx',
'raw' ) ) .
")" );
246 $dbw->query(
"CALL ctx_ddl.sync_index(" .
247 $dbw->addQuotes( $dbw->getDBname() .
'.' . $dbw->tableName(
'si_title_idx',
'raw' ) ) .
")" );
260 $dbw->update(
'searchindex',
262 array(
'si_page' => $id ),
263 'SearchOracle::updateTitle',
268 return "\"" . parent::legalSearchChars();
updateTitle( $id, $title)
Update a search index record's title only.
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
& wfGetDB( $db, $groups=array(), $wiki=false)
Get a Database object.
Search engine hook base class for Oracle (ConText).
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
parseQuery( $filteredText, $fulltext)
Parse a user input search string, and return an SQL fragment to be used as part of a WHERE clause.
getQuery( $filteredTerm, $fulltext)
Construct the full SQL query to do the search.
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.
update( $id, $title, $text)
Create or update the search index record for the given page.
queryRanking( $filteredTerm, $fulltext)
Does not do anything for generic search engine subclasses may define this though.
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
queryMain( $filteredTerm, $fulltext)
Get the base part of the search query.
queryLimit( $sql)
Return a LIMIT clause to limit results on the query.
searchTitle( $term)
Perform a title-only search query and return a result set.
presenting them properly to the user as errors is done by the caller $title
This class is used for different SQL-based search engines shipped with MediaWiki.
static legalSearchChars()
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
static legalSearchChars()
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.