SearchMySQL Class Reference
[Search]

Search engine hook for MySQL 4+. More...

Inherits SearchEngine.

Inherited by SearchMySQL4.

List of all members.

Public Member Functions

 __construct ($db)
 parseQuery ($filteredText, $fulltext)
 Parse the user's query and transform it into an SQL fragment which will become part of a WHERE clause.
 searchText ($term)
 Perform a full text search query and return a result set.
 searchTitle ($term)
 Perform a title-only search query and return a result set.
 queryRedirect ()
 Return a partial WHERE clause to exclude redirects, if so set.
 queryNamespaces ()
 Return a partial WHERE clause to limit the search to the given namespaces.
 queryLimit ()
 Return a LIMIT clause to limit results on the query.
 queryRanking ($filteredTerm, $fulltext)
 Does not do anything for generic search engine subclasses may define this though.
 getQuery ($filteredTerm, $fulltext)
 Construct the full SQL query to do the search.
 getIndexField ($fulltext)
 Picks which field to index on, depending on what type of query.
 queryMain ($filteredTerm, $fulltext)
 Get the base part of the search query.
 update ($id, $title, $text)
 Create or update the search index record for the given page.
 updateTitle ($id, $title)
 Update a search index record's title only.

Static Public Member Functions

static legalSearchChars ()

Public Attributes

 $strictMatching = true


Detailed Description

Search engine hook for MySQL 4+.

Definition at line 29 of file SearchMySQL.php.


Constructor & Destructor Documentation

SearchMySQL::__construct ( db  ) 

Todo:
document

Definition at line 33 of file SearchMySQL.php.

References $db.


Member Function Documentation

SearchMySQL::getIndexField ( fulltext  ) 

Picks which field to index on, depending on what type of query.

Parameters:
bool $fulltext
Returns:
string

Definition at line 180 of file SearchMySQL.php.

Referenced by parseQuery().

SearchMySQL::getQuery ( filteredTerm,
fulltext 
)

Construct the full SQL query to do the search.

The guts shoulds be constructed in queryMain()

Parameters:
string $filteredTerm
bool $fulltext
Access:
private

Definition at line 166 of file SearchMySQL.php.

References queryLimit(), queryMain(), queryNamespaces(), queryRanking(), and queryRedirect().

static SearchMySQL::legalSearchChars (  )  [static]

Reimplemented from SearchEngine.

Definition at line 82 of file SearchMySQL.php.

Referenced by parseQuery().

SearchMySQL::parseQuery ( filteredText,
fulltext 
)

Parse the user's query and transform it into an SQL fragment which will become part of a WHERE clause.

Definition at line 41 of file SearchMySQL.php.

References $wgContLang, getIndexField(), legalSearchChars(), and wfDebug().

Referenced by queryMain().

SearchMySQL::queryLimit (  ) 

Return a LIMIT clause to limit results on the query.

Returns:
string
Access:
private

Definition at line 145 of file SearchMySQL.php.

Referenced by getQuery().

SearchMySQL::queryMain ( filteredTerm,
fulltext 
)

Get the base part of the search query.

The actual match syntax will depend on the server version; MySQL 3 and MySQL 4 have different capabilities in their fulltext search indexes.

Parameters:
string $filteredTerm
bool $fulltext
Returns:
string
Access:
private

Definition at line 195 of file SearchMySQL.php.

References $page, and parseQuery().

Referenced by getQuery().

SearchMySQL::queryNamespaces (  ) 

Return a partial WHERE clause to limit the search to the given namespaces.

Returns:
string
Access:
private

Definition at line 129 of file SearchMySQL.php.

References SearchEngine::$namespaces.

Referenced by getQuery().

SearchMySQL::queryRanking ( filteredTerm,
fulltext 
)

Does not do anything for generic search engine subclasses may define this though.

Returns:
string
Access:
private

Definition at line 155 of file SearchMySQL.php.

Referenced by getQuery().

SearchMySQL::queryRedirect (  ) 

Return a partial WHERE clause to exclude redirects, if so set.

Returns:
string
Access:
private

Definition at line 116 of file SearchMySQL.php.

Referenced by getQuery().

SearchMySQL::searchText ( term  ) 

Perform a full text search query and return a result set.

Parameters:
string $term - Raw search term
Returns:
MySQLSearchResultSet
Access:
public

Reimplemented from SearchEngine.

Definition at line 93 of file SearchMySQL.php.

SearchMySQL::searchTitle ( term  ) 

Perform a title-only search query and return a result set.

Parameters:
string $term - Raw search term
Returns:
MySQLSearchResultSet
Access:
public

Reimplemented from SearchEngine.

Definition at line 105 of file SearchMySQL.php.

SearchMySQL::update ( id,
title,
text 
)

Create or update the search index record for the given page.

Title and text should be pre-processed.

Parameters:
int $id
string $title
string $text

Reimplemented from SearchEngine.

Definition at line 212 of file SearchMySQL.php.

References $dbw, $text, $title, and wfGetDB().

SearchMySQL::updateTitle ( id,
title 
)

Update a search index record's title only.

Title should be pre-processed.

Parameters:
int $id
string $title

Reimplemented from SearchEngine.

Definition at line 230 of file SearchMySQL.php.

References $dbw, $title, and wfGetDB().


Member Data Documentation

SearchMySQL::$strictMatching = true

Definition at line 30 of file SearchMySQL.php.


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

Generated on Sat Sep 5 02:08:46 2009 for MediaWiki by  doxygen 1.5.9