MediaWiki  REL1_24
SearchSqlite Class Reference

Search engine hook for SQLite. More...

Inheritance diagram for SearchSqlite:
Collaboration diagram for SearchSqlite:

List of all members.

Public Member Functions

 fulltextSearchSupported ()
 Whether fulltext search is supported by current schema.
 getCountQuery ($filteredTerm, $fulltext)
 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.
 limitResult ($sql)
 Returns a query with limit for number of results set.
 parseQuery ($filteredText, $fulltext)
 Parse the user's query and transform it into an SQL fragment which will become part of a WHERE clause.
 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.
 regexTerm ($string, $wildcard)
 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 ()

Protected Member Functions

 searchInternal ($term, $fulltext)

Detailed Description

Search engine hook for SQLite.

Definition at line 28 of file SearchSqlite.php.


Member Function Documentation

Whether fulltext search is supported by current schema.

Returns:
bool

Definition at line 33 of file SearchSqlite.php.

Referenced by searchInternal(), update(), and updateTitle().

SearchSqlite::getCountQuery ( filteredTerm,
fulltext 
)

Definition at line 253 of file SearchSqlite.php.

References parseQuery(), and queryNamespaces().

Referenced by searchInternal().

SearchSqlite::getIndexField ( fulltext)

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

Parameters:
bool$fulltext
Returns:
string

Definition at line 233 of file SearchSqlite.php.

Referenced by parseQuery().

SearchSqlite::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 221 of file SearchSqlite.php.

References limitResult(), queryMain(), and queryNamespaces().

Referenced by searchInternal().

static SearchSqlite::legalSearchChars ( ) [static]

Reimplemented from SearchEngine.

Definition at line 144 of file SearchSqlite.php.

Referenced by parseQuery().

Returns a query with limit for number of results set.

Parameters:
string$sql
Returns:
string

Definition at line 210 of file SearchSqlite.php.

Referenced by getQuery().

SearchSqlite::parseQuery ( filteredText,
fulltext 
)

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

Parameters:
string$filteredText
bool$fulltext
Returns:
string

Definition at line 45 of file SearchSqlite.php.

References $regexp, $term, $wgContLang, array(), as, getIndexField(), global, legalSearchChars(), list, regexTerm(), wfDebug(), wfRestoreWarnings(), and wfSuppressWarnings().

Referenced by getCountQuery(), and queryMain().

SearchSqlite::queryMain ( filteredTerm,
fulltext 
)

Get the base part of the search query.

Parameters:
string$filteredTerm
bool$fulltext
Returns:
string

Definition at line 244 of file SearchSqlite.php.

References parseQuery().

Referenced by getQuery().

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

Returns:
string

Definition at line 193 of file SearchSqlite.php.

References SearchEngine\$namespaces, and namespaces.

Referenced by getCountQuery(), and getQuery().

SearchSqlite::regexTerm ( string,
wildcard 
)

Definition at line 125 of file SearchSqlite.php.

References $wgContLang, and global.

Referenced by parseQuery().

SearchSqlite::searchInternal ( term,
fulltext 
) [protected]

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

Parameters:
string$termRaw search term
Returns:
SqlSearchResultSet

Reimplemented from SearchEngine.

Definition at line 154 of file SearchSqlite.php.

References $term, and searchInternal().

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

Parameters:
string$termRaw search term
Returns:
SqlSearchResultSet

Reimplemented from SearchEngine.

Definition at line 164 of file SearchSqlite.php.

References $term, and searchInternal().

SearchSqlite::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 271 of file SearchSqlite.php.

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

SearchSqlite::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 296 of file SearchSqlite.php.

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


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