MediaWiki  REL1_19
SearchOracle Class Reference

Search engine hook base class for Oracle (ConText). More...

Inheritance diagram for SearchOracle:
Collaboration diagram for SearchOracle:

List of all members.

Public Member Functions

 __construct ($db)
 Creates an instance of this class.
 getIndexField ($fulltext)
 Picks which field to index on, depending on what type of query.
 getQuery ($filteredTerm, $fulltext)
 Construct the full SQL query to do the search.
 parseQuery ($filteredText, $fulltext)
 Parse a user input search string, and return an SQL fragment to be used as part of a WHERE clause.
 queryLimit ($sql)
 Return a LIMIT clause to limit results on the query.
 queryMain ($filteredTerm, $fulltext)
 Get the base part of the search query.
 queryNamespaces ()
 Return a partial WHERE clause to limit the search to the given namespaces.
 queryRanking ($filteredTerm, $fulltext)
 Does not do anything for generic search engine subclasses may define this though.
 queryRedirect ()
 Return a partial WHERE clause to exclude redirects, if so set.
 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.
 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 ()

Private Member Functions

 escapeTerm ($t)

Private Attributes

 $reservedWords

Detailed Description

Search engine hook base class for Oracle (ConText).

Definition at line 31 of file SearchOracle.php.


Constructor & Destructor Documentation

Creates an instance of this class.

Parameters:
$dbDatabasePostgres: database object

Reimplemented from SearchEngine.

Definition at line 64 of file SearchOracle.php.

References SearchEngine\$db.


Member Function Documentation

SearchOracle::escapeTerm ( t) [private]

Definition at line 228 of file SearchOracle.php.

References $t, and $wgContLang.

Referenced by parseQuery().

Here is the caller graph for this function:

SearchOracle::getIndexField ( fulltext)

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

Parameters:
$fulltextBoolean
Returns:
String

Definition at line 164 of file SearchOracle.php.

Referenced by parseQuery().

Here is the caller graph for this function:

SearchOracle::getQuery ( filteredTerm,
fulltext 
)

Construct the full SQL query to do the search.

The guts shoulds be constructed in queryMain()

Parameters:
$filteredTermString
$fulltextBoolean

Definition at line 151 of file SearchOracle.php.

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

Here is the call graph for this function:

static SearchOracle::legalSearchChars ( ) [static]

Reimplemented from SearchEngine.

Definition at line 283 of file SearchOracle.php.

Referenced by parseQuery().

Here is the caller graph for this function:

SearchOracle::parseQuery ( filteredText,
fulltext 
)

Parse a user input search string, and return an SQL fragment to be used as part of a WHERE clause.

Definition at line 188 of file SearchOracle.php.

References $t, $wgContLang, escapeTerm(), getIndexField(), and legalSearchChars().

Referenced by queryMain().

Here is the call graph for this function:

Here is the caller graph for this function:

Return a LIMIT clause to limit results on the query.

Parameters:
string
Returns:
String

Definition at line 131 of file SearchOracle.php.

Referenced by getQuery().

Here is the caller graph for this function:

SearchOracle::queryMain ( filteredTerm,
fulltext 
)

Get the base part of the search query.

Parameters:
$filteredTermString
$fulltextBoolean
Returns:
String

Definition at line 175 of file SearchOracle.php.

References $page, and parseQuery().

Referenced by getQuery().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Returns:
String

Definition at line 113 of file SearchOracle.php.

References SearchEngine\$namespaces.

Referenced by getQuery().

Here is the caller graph for this function:

SearchOracle::queryRanking ( filteredTerm,
fulltext 
)

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

Returns:
String

Definition at line 141 of file SearchOracle.php.

Referenced by getQuery().

Here is the caller graph for this function:

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

Returns:
String

Definition at line 101 of file SearchOracle.php.

Referenced by getQuery().

Here is the caller graph for this function:

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

Parameters:
$termString: raw search term
Returns:
SqlSearchResultSet

Reimplemented from SearchEngine.

Definition at line 74 of file SearchOracle.php.

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

Parameters:
$termString: raw search term
Returns:
SqlSearchResultSet

Reimplemented from SearchEngine.

Definition at line 88 of file SearchOracle.php.

SearchOracle::update ( id,
title,
text 
)

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

Title and text should be pre-processed.

Parameters:
$idInteger
$titleString
$textString

Reimplemented from SearchEngine.

Definition at line 244 of file SearchOracle.php.

References $title, and wfGetDB().

Here is the call graph for this function:

SearchOracle::updateTitle ( id,
title 
)

Update a search index record's title only.

Title should be pre-processed.

Parameters:
$idInteger
$titleString

Reimplemented from SearchEngine.

Definition at line 272 of file SearchOracle.php.

References $title, and wfGetDB().

Here is the call graph for this function:


Member Data Documentation

SearchOracle::$reservedWords [private]
Initial value:
 array ('ABOUT' => 1, 
                                                                        'ACCUM' => 1, 
                                                                        'AND' => 1, 
                                                                        'BT' => 1, 
                                                                        'BTG' => 1, 
                                                                        'BTI' => 1, 
                                                                        'BTP' => 1,
                                                                        'FUZZY' => 1, 
                                                                        'HASPATH' => 1, 
                                                                        'INPATH' => 1, 
                                                                        'MINUS' => 1, 
                                                                        'NEAR' => 1, 
                                                                        'NOT' => 1,
                                                                        'NT' => 1, 
                                                                        'NTG' => 1, 
                                                                        'NTI' => 1, 
                                                                        'NTP' => 1, 
                                                                        'OR' => 1, 
                                                                        'PT' => 1, 
                                                                        'RT' => 1, 
                                                                        'SQE' => 1,
                                                                        'SYN' => 1, 
                                                                        'TR' => 1, 
                                                                        'TRSYN' => 1, 
                                                                        'TT' => 1, 
                                                                        'WITHIN' => 1)

Definition at line 33 of file SearchOracle.php.


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