TtmServer backend based on ElasticSearch. More...
Public Member Functions | |
isLocalSuggestion (array $suggestion) | |
Determines if the suggestion returned by this TtmServer comes from this wiki or any other wiki. | |
expandLocation (array $suggestion) | |
Given suggestion returned by this TtmServer, constructs fully qualified URL to the location of the translation. | |
query (string $sourceLanguage, string $targetLanguage, string $text) | |
Fetches all relevant suggestions for given text. | |
update (MessageHandle $handle, ?string $targetText) | |
Shovels the new translation into translation memory. | |
beginBootstrap () | |
Begin the bootstrap process. | |
beginBatch () | |
Called before every batch (MessageGroup). | |
batchInsertDefinitions (array $batch) | |
batchInsertTranslations (array $batch) | |
Called multiple times per batch if necessary. | |
endBatch () | |
Called after every batch (MessageGroup). | |
endBootstrap () | |
Do any cleanup, optimizing etc. | |
getClient () | |
useWikimediaExtraPlugin () | |
getIndex () | |
setLogger (TTMServerBootstrap $logger) | |
setDoReIndex () | |
Instruct the service to fully wipe the index and start from scratch. | |
createSearch (string $queryString, array $opts, array $highlight) | |
Search interface. | |
search (string $queryString, array $opts, array $highlight) | |
Search interface. | |
getFacets ( $resultset) | |
@inheritDoc | |
getTotalHits ( $resultset) | |
@inheritDoc | |
getDocuments ( $resultset) | |
@inheritDoc | |
Public Member Functions inherited from MediaWiki\Extension\Translate\TtmServer\TtmServer | |
__construct (array $config) | |
Additional Inherited Members | |
Static Public Member Functions inherited from MediaWiki\Extension\Translate\TtmServer\TtmServer | |
static | sortSuggestions (array $suggestions) |
static | onDelete (WikiPage $wikipage) |
Hook: ArticleDeleteComplete. | |
static | onChange (MessageHandle $handle) |
Called from TranslateEditAddons::onSave. | |
static | onGroupChange (MessageHandle $handle, array $old) |
Protected Attributes inherited from MediaWiki\Extension\Translate\TtmServer\TtmServer | |
array | $config |
TtmServer backend based on ElasticSearch.
Depends on Elastica.
Definition at line 38 of file ElasticSearchTtmServer.php.
MediaWiki\Extension\Translate\TtmServer\ElasticSearchTtmServer::batchInsertDefinitions | ( | array | $batch | ) |
array[] | $batch | @phan-param array<int,array{0:MessageHandle,1:string,2:string}> $batch |
Implements MediaWiki\Extension\Translate\TtmServer\WritableTtmServer.
Definition at line 402 of file ElasticSearchTtmServer.php.
MediaWiki\Extension\Translate\TtmServer\ElasticSearchTtmServer::batchInsertTranslations | ( | array | $batch | ) |
Called multiple times per batch if necessary.
Implements MediaWiki\Extension\Translate\TtmServer\WritableTtmServer.
Definition at line 412 of file ElasticSearchTtmServer.php.
MediaWiki\Extension\Translate\TtmServer\ElasticSearchTtmServer::beginBatch | ( | ) |
Called before every batch (MessageGroup).
Implements MediaWiki\Extension\Translate\TtmServer\WritableTtmServer.
Definition at line 395 of file ElasticSearchTtmServer.php.
MediaWiki\Extension\Translate\TtmServer\ElasticSearchTtmServer::beginBootstrap | ( | ) |
Begin the bootstrap process.
RuntimeException |
Implements MediaWiki\Extension\Translate\TtmServer\WritableTtmServer.
Definition at line 345 of file ElasticSearchTtmServer.php.
MediaWiki\Extension\Translate\TtmServer\ElasticSearchTtmServer::createSearch | ( | string | $queryString, |
array | $opts, | ||
array | $highlight ) |
Search interface.
Definition at line 573 of file ElasticSearchTtmServer.php.
MediaWiki\Extension\Translate\TtmServer\ElasticSearchTtmServer::endBatch | ( | ) |
Called after every batch (MessageGroup).
Implements MediaWiki\Extension\Translate\TtmServer\WritableTtmServer.
Definition at line 433 of file ElasticSearchTtmServer.php.
MediaWiki\Extension\Translate\TtmServer\ElasticSearchTtmServer::endBootstrap | ( | ) |
Do any cleanup, optimizing etc.
Implements MediaWiki\Extension\Translate\TtmServer\WritableTtmServer.
Definition at line 436 of file ElasticSearchTtmServer.php.
MediaWiki\Extension\Translate\TtmServer\ElasticSearchTtmServer::expandLocation | ( | array | $suggestion | ) |
Given suggestion returned by this TtmServer, constructs fully qualified URL to the location of the translation.
Implements MediaWiki\Extension\Translate\TtmServer\ReadableTtmServer.
Definition at line 66 of file ElasticSearchTtmServer.php.
MediaWiki\Extension\Translate\TtmServer\ElasticSearchTtmServer::getClient | ( | ) |
Definition at line 443 of file ElasticSearchTtmServer.php.
MediaWiki\Extension\Translate\TtmServer\ElasticSearchTtmServer::getDocuments | ( | $resultset | ) |
@inheritDoc
Implements MediaWiki\Extension\Translate\TtmServer\SearchableTtmServer.
Definition at line 674 of file ElasticSearchTtmServer.php.
MediaWiki\Extension\Translate\TtmServer\ElasticSearchTtmServer::getFacets | ( | $resultset | ) |
@inheritDoc
Implements MediaWiki\Extension\Translate\TtmServer\SearchableTtmServer.
Definition at line 648 of file ElasticSearchTtmServer.php.
MediaWiki\Extension\Translate\TtmServer\ElasticSearchTtmServer::getIndex | ( | ) |
Definition at line 463 of file ElasticSearchTtmServer.php.
MediaWiki\Extension\Translate\TtmServer\ElasticSearchTtmServer::getTotalHits | ( | $resultset | ) |
@inheritDoc
Implements MediaWiki\Extension\Translate\TtmServer\SearchableTtmServer.
Definition at line 668 of file ElasticSearchTtmServer.php.
MediaWiki\Extension\Translate\TtmServer\ElasticSearchTtmServer::isLocalSuggestion | ( | array | $suggestion | ) |
Determines if the suggestion returned by this TtmServer comes from this wiki or any other wiki.
Implements MediaWiki\Extension\Translate\TtmServer\ReadableTtmServer.
Definition at line 62 of file ElasticSearchTtmServer.php.
MediaWiki\Extension\Translate\TtmServer\ElasticSearchTtmServer::query | ( | string | $sourceLanguage, |
string | $targetLanguage, | ||
string | $text ) |
Fetches all relevant suggestions for given text.
string | $sourceLanguage | language code for the provide text |
string | $targetLanguage | language code for the suggestions |
string | $text | the text for which to search suggestions |
Implements MediaWiki\Extension\Translate\TtmServer\ReadableTtmServer.
Definition at line 70 of file ElasticSearchTtmServer.php.
MediaWiki\Extension\Translate\TtmServer\ElasticSearchTtmServer::search | ( | string | $queryString, |
array | $opts, | ||
array | $highlight ) |
Search interface.
TtmServerException |
Implements MediaWiki\Extension\Translate\TtmServer\SearchableTtmServer.
Definition at line 637 of file ElasticSearchTtmServer.php.
MediaWiki\Extension\Translate\TtmServer\ElasticSearchTtmServer::setDoReIndex | ( | ) |
Instruct the service to fully wipe the index and start from scratch.
Implements MediaWiki\Extension\Translate\TtmServer\WritableTtmServer.
Definition at line 502 of file ElasticSearchTtmServer.php.
MediaWiki\Extension\Translate\TtmServer\ElasticSearchTtmServer::setLogger | ( | TTMServerBootstrap | $logger | ) |
Definition at line 491 of file ElasticSearchTtmServer.php.
MediaWiki\Extension\Translate\TtmServer\ElasticSearchTtmServer::update | ( | MessageHandle | $handle, |
?string | $targetText ) |
Shovels the new translation into translation memory.
Use this for single updates (=after message edit). If no text is provided, entry will be removed from the translation memory.
MessageHandle | $handle | |
string | null | $targetText | Use null to only delete. |
Implements MediaWiki\Extension\Translate\TtmServer\WritableTtmServer.
Definition at line 231 of file ElasticSearchTtmServer.php.
MediaWiki\Extension\Translate\TtmServer\ElasticSearchTtmServer::useWikimediaExtraPlugin | ( | ) |
Definition at line 455 of file ElasticSearchTtmServer.php.