Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\Store\Sql\TermSearchKeyBuilder Class Reference

Utility class for rebuilding the term_search_key field. More...

Public Member Functions

 __construct (TermSqlIndex $table, LoggerInterface $logger)
 
 setRebuildAll ( $all)
 
 setBatchSize ( $batchSize)
 
 setFromId ( $fromId)
 
 setReporter (MessageReporter $reporter)
 Sets the reporter to use for reporting preogress.
 
 rebuildSearchKey ()
 Rebuild the search key field term_search_key from the source term_text field.
 

Private Member Functions

 updateSearchKey (IDatabase $dbw, $rowId, $text)
 Updates a single row with a newley calculated search key.
 
 report ( $msg)
 

Private Attributes

 $table
 
 $logger
 
 $reporter = null
 
 $all = true
 
 $fromId = 1
 
 $batchSize = 100
 

Detailed Description

Utility class for rebuilding the term_search_key field.

Deprecated:
This will disappear after the wb_terms table removal.
Author
Jeroen De Dauw < jeroe.nosp@m.nded.nosp@m.auw@g.nosp@m.mail.nosp@m..com >
Jens Ohlig < jens..nosp@m.ohli.nosp@m.g@wik.nosp@m.imed.nosp@m.ia.de >
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Store\Sql\TermSearchKeyBuilder::__construct ( TermSqlIndex  $table,
LoggerInterface  $logger 
)

Member Function Documentation

◆ rebuildSearchKey()

Wikibase\Repo\Store\Sql\TermSearchKeyBuilder::rebuildSearchKey ( )

Rebuild the search key field term_search_key from the source term_text field.

Use the rebuildSearchKey.php maintenance script to invoke this from the command line.

Database updates a batched into multiple transactions. Do not call this method whithin an (explicite) database transaction.

◆ report()

Wikibase\Repo\Store\Sql\TermSearchKeyBuilder::report (   $msg)
private
Parameters
string$msg

◆ setBatchSize()

Wikibase\Repo\Store\Sql\TermSearchKeyBuilder::setBatchSize (   $batchSize)
Parameters
int$batchSize

◆ setFromId()

Wikibase\Repo\Store\Sql\TermSearchKeyBuilder::setFromId (   $fromId)
Parameters
int$fromId

◆ setRebuildAll()

Wikibase\Repo\Store\Sql\TermSearchKeyBuilder::setRebuildAll (   $all)
Parameters
bool$all

◆ setReporter()

Wikibase\Repo\Store\Sql\TermSearchKeyBuilder::setReporter ( MessageReporter  $reporter)

Sets the reporter to use for reporting preogress.

Parameters
MessageReporter$reporter

◆ updateSearchKey()

Wikibase\Repo\Store\Sql\TermSearchKeyBuilder::updateSearchKey ( IDatabase  $dbw,
  $rowId,
  $text 
)
private

Updates a single row with a newley calculated search key.

The search key is calculated using TermSqlIndex::getSearchKey().

See also
TermSqlIndex::getSearchKey
Parameters
IDatabase$dbwthe database connection to use
int$rowIdthe row to update
string$textthe term's text
Returns
string|bool the search key, or false if no search key could be calculated.

Member Data Documentation

◆ $all

Wikibase\Repo\Store\Sql\TermSearchKeyBuilder::$all = true
private

◆ $batchSize

Wikibase\Repo\Store\Sql\TermSearchKeyBuilder::$batchSize = 100
private

◆ $fromId

Wikibase\Repo\Store\Sql\TermSearchKeyBuilder::$fromId = 1
private

◆ $logger

Wikibase\Repo\Store\Sql\TermSearchKeyBuilder::$logger
private

◆ $reporter

Wikibase\Repo\Store\Sql\TermSearchKeyBuilder::$reporter = null
private

◆ $table

Wikibase\Repo\Store\Sql\TermSearchKeyBuilder::$table
private

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