Semantic MediaWiki and related extensions
Public Member Functions | List of all members
SMW\MediaWiki\Search\Search Class Reference
Collaboration diagram for SMW\MediaWiki\Search\Search:
Collaboration graph
[legend]

Public Member Functions

 setFallbackSearchEngine (SearchEngine $fallbackSearch=null)
 
 getFallbackSearchEngine ()
 
 setDB (DatabaseBase $connection)
 
 getDB ()
 
 searchTitle ($term)
 
 searchText ($term)
 
 supports ($feature)
 
 normalizeText ($string)
 
 getTextFromContent (Title $t, Content $c=null)
 
 textAlreadyUpdatedForIndex ()
 
 update ($id, $title, $text)
 
 updateTitle ($id, $title)
 
 delete ($id, $title)
 
 setFeatureData ($feature, $data)
 
 getFeatureData ($feature)
 
 replacePrefixes ($query)
 
 transformSearchTerm ($term)
 
 getLimit ()
 
 getOffset ()
 
 getShowSuggestion ()
 
 setLimitOffset ($limit, $offset=0)
 
 setNamespaces ($namespaces)
 
 setShowSuggestion ($showSuggestion)
 

Detailed Description

Search engine that will try to find wiki pages by interpreting the search term as an SMW query.

If successful, the pages according to the query will be returned. If not it falls back to the default search engine.

GNU GPL v2+

Since
2.1
Author
Stephan Gambke

Member Function Documentation

SMW\MediaWiki\Search\Search::delete (   $id,
  $title 
)

Delete an indexed page Title should be pre-processed.

Parameters
int$idPage id that was deleted
string$titleTitle of page that was deleted
SMW\MediaWiki\Search\Search::getDB ( )
Returns
SMW\MediaWiki\Search\Search::getFallbackSearchEngine ( )
Returns
SearchEngine
SMW\MediaWiki\Search\Search::getFeatureData (   $feature)
Parameters
String$feature
Returns
array|null
SMW\MediaWiki\Search\Search::getLimit ( )
Returns
int
SMW\MediaWiki\Search\Search::getOffset ( )
Returns
int
SMW\MediaWiki\Search\Search::getShowSuggestion ( )
Returns
boolean
SMW\MediaWiki\Search\Search::getTextFromContent ( Title  $t,
Content  $c = null 
)
SMW\MediaWiki\Search\Search::normalizeText (   $string)

May performs database-specific conversions on text to be used for searching or updating search index.

Parameters
string$stringString to process
Returns
string
SMW\MediaWiki\Search\Search::replacePrefixes (   $query)

SMW queries do not have prefixes. Returns query as is.

Parameters
string$query
Returns
string
SMW\MediaWiki\Search\Search::searchText (   $term)

Perform a full text search query and return a result set. If title searches are not supported or disabled, return null.

Parameters
string$termRaw search term
Returns
SearchResultSet||null
SMW\MediaWiki\Search\Search::searchTitle (   $term)

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

This method will try to find wiki pages by interpreting the search term as an SMW query.

If successful, the pages according to the query will be returned. If not, it falls back to the default search engine.

Parameters
string$termRaw search term
Returns
SearchResultSet|null
SMW\MediaWiki\Search\Search::setDB ( DatabaseBase  $connection)
Parameters
DatabaseBase$connection
SMW\MediaWiki\Search\Search::setFallbackSearchEngine ( SearchEngine  $fallbackSearch = null)
Parameters
null | SearchEngine$fallbackSearch
SMW\MediaWiki\Search\Search::setFeatureData (   $feature,
  $data 
)
SMW\MediaWiki\Search\Search::setLimitOffset (   $limit,
  $offset = 0 
)
SMW\MediaWiki\Search\Search::setNamespaces (   $namespaces)
SMW\MediaWiki\Search\Search::setShowSuggestion (   $showSuggestion)
SMW\MediaWiki\Search\Search::supports (   $feature)
Parameters
string$feature
Returns
bool
SMW\MediaWiki\Search\Search::textAlreadyUpdatedForIndex ( )
SMW\MediaWiki\Search\Search::transformSearchTerm (   $term)

No Transformation needed. Returns term as is.

Parameters
$term
Returns
mixed
SMW\MediaWiki\Search\Search::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
SMW\MediaWiki\Search\Search::updateTitle (   $id,
  $title 
)

Update a search index record's title only. Title should be pre-processed.

Parameters
int$id
string$title

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