MediaWiki  REL1_24
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

 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.
 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.


Member Function Documentation

SearchOracle::escapeTerm ( t) [private]

Definition at line 215 of file SearchOracle.php.

References $t, $wgContLang, and global.

Referenced by parseQuery().

SearchOracle::getIndexField ( fulltext)

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

Parameters:
bool$fulltext
Returns:
string

Definition at line 148 of file SearchOracle.php.

Referenced by parseQuery().

SearchOracle::getQuery ( filteredTerm,
fulltext 
)

Construct the full SQL query to do the search.

The guts shoulds be constructed in queryMain()

Parameters:
string$filteredTerm
bool$fulltext
Returns:
string

Definition at line 137 of file SearchOracle.php.

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

Referenced by searchText(), and searchTitle().

static SearchOracle::legalSearchChars ( ) [static]

Reimplemented from SearchEngine.

Definition at line 270 of file SearchOracle.php.

Referenced by parseQuery().

SearchOracle::parseQuery ( filteredText,
fulltext 
)

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

Parameters:
string$filteredText
bool$fulltext
Returns:
string

Definition at line 175 of file SearchOracle.php.

References $regexp, $t, $wgContLang, array(), as, empty, escapeTerm(), getIndexField(), global, and legalSearchChars().

Referenced by queryMain().

Return a LIMIT clause to limit results on the query.

Parameters:
string$sql
Returns:
string

Definition at line 114 of file SearchOracle.php.

Referenced by getQuery().

SearchOracle::queryMain ( filteredTerm,
fulltext 
)

Get the base part of the search query.

Parameters:
string$filteredTerm
bool$fulltext
Returns:
string

Definition at line 159 of file SearchOracle.php.

References parseQuery().

Referenced by getQuery().

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

Returns:
string

Definition at line 95 of file SearchOracle.php.

References SearchEngine\$namespaces, and namespaces.

Referenced by getQuery().

SearchOracle::queryRanking ( filteredTerm,
fulltext 
)

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

Parameters:
string$filteredTerm
bool$fulltext
Returns:
string

Definition at line 126 of file SearchOracle.php.

Referenced by getQuery().

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

Parameters:
string$termRaw search term
Returns:
SqlSearchResultSet

Reimplemented from SearchEngine.

Definition at line 67 of file SearchOracle.php.

References $term, SearchDatabase\filter(), and getQuery().

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

Parameters:
string$termRaw search term
Returns:
SqlSearchResultSet

Reimplemented from SearchEngine.

Definition at line 82 of file SearchOracle.php.

References $term, SearchDatabase\filter(), and getQuery().

SearchOracle::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 232 of file SearchOracle.php.

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

SearchOracle::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 260 of file SearchOracle.php.

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


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 32 of file SearchOracle.php.


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