Wikibase
MediaWiki Wikibase extension
|
(Re)builds term index in the SQL table. More...
Public Member Functions | |
__construct (ILBFactory $loadBalancerFactory, TermSqlIndex $termSqlIndex, SqlEntityIdPagerFactory $entityIdPagerFactory, EntityRevisionLookup $entityRevisionLookup, array $entityTypes, $sleep=0) | |
setProgressReporter (MessageReporter $reporter) | |
setErrorReporter (MessageReporter $reporter) | |
setBatchSize ( $size) | |
rebuild () | |
setFromId ( $fromId) | |
setRebuildAllEntityTerms ( $rebuildAllEntityTerms) | |
Enables or disables the complete rebuilding of entity terms, i.e. | |
setRemoveDuplicateTerms ( $removeDuplicateTerms) | |
Enables or disables checking if the index contains duplicate terms for the particular entity, and removing duplicates if found any. | |
Public Attributes | |
const | TABLE_NAME = 'wb_terms' |
Private Member Functions | |
rebuildForEntityType ( $entityType) | |
rebuildTermsForBatch (array $entityIds, ILoadBalancer $loadBalancer, $transactionTicket) | |
rebuildEntityTerms (IDatabase $dbr, IDatabase $dbw, EntityId $entityId) | |
rebuildAllTermsOfEntity (EntityId $entityId) | |
getDuplicateTerms (array $terms) | |
Private Attributes | |
$loadBalancerFactory | |
$termSqlIndex | |
$entityIdPagerFactory | |
$entityRevisionLookup | |
$entityTypes | |
$sleep | |
$progressReporter | |
$errorReporter | |
$batchSize = 1000 | |
$removeDuplicateTerms = false | |
$rebuildAllEntityTerms = false | |
$fromId = null | |
(Re)builds term index in the SQL table.
This can add missing information to the SQL table like missing full entity ID. It also removes possible duplicate terms. It can also ensure that all expected entity terms are stored in the term index, i.e. add all possible missing terms of the given entity, and remove all possible no longer valid terms of the entity, even if there is no other need for rebuilding the index (i.e. all ID fields are populated, there are no duplicate entries).
Wikibase\Repo\Store\Sql\TermSqlIndexBuilder::__construct | ( | ILBFactory | $loadBalancerFactory, |
TermSqlIndex | $termSqlIndex, | ||
SqlEntityIdPagerFactory | $entityIdPagerFactory, | ||
EntityRevisionLookup | $entityRevisionLookup, | ||
array | $entityTypes, | ||
$sleep = 0 |
|||
) |
ILBFactory | $loadBalancerFactory | |
TermSqlIndex | $termSqlIndex | |
SqlEntityIdPagerFactory | $entityIdPagerFactory | |
EntityRevisionLookup | $entityRevisionLookup | |
string[] | $entityTypes | |
int | $sleep | Sleep time between each batch |
|
private |
TermIndexEntry[] | $terms |
Wikibase\Repo\Store\Sql\TermSqlIndexBuilder::rebuild | ( | ) |
|
private |
|
private |
|
private |
string | $entityType |
|
private |
EntityId[] | $entityIds | |
ILoadBalancer | $loadBalancer | |
mixed | $transactionTicket |
Wikibase\Repo\Store\Sql\TermSqlIndexBuilder::setBatchSize | ( | $size | ) |
int | $size |
Wikibase\Repo\Store\Sql\TermSqlIndexBuilder::setErrorReporter | ( | MessageReporter | $reporter | ) |
Wikibase\Repo\Store\Sql\TermSqlIndexBuilder::setFromId | ( | $fromId | ) |
int | $fromId |
Wikibase\Repo\Store\Sql\TermSqlIndexBuilder::setProgressReporter | ( | MessageReporter | $reporter | ) |
Wikibase\Repo\Store\Sql\TermSqlIndexBuilder::setRebuildAllEntityTerms | ( | $rebuildAllEntityTerms | ) |
Enables or disables the complete rebuilding of entity terms, i.e.
removing all existing terms of the entity, and adding its terms to the index again.
bool | $rebuildAllEntityTerms |
Wikibase\Repo\Store\Sql\TermSqlIndexBuilder::setRemoveDuplicateTerms | ( | $removeDuplicateTerms | ) |
Enables or disables checking if the index contains duplicate terms for the particular entity, and removing duplicates if found any.
Note this setting is redundant if the complete rebuild of the entity term index is enabled.
bool | $removeDuplicateTerms |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
const Wikibase\Repo\Store\Sql\TermSqlIndexBuilder::TABLE_NAME = 'wb_terms' |