mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-16 20:02:40 +01:00
31 lines
579 B
PHP
31 lines
579 B
PHP
|
<?php
|
||
|
|
||
|
final class PhabricatorFulltextIndexEngineExtension
|
||
|
extends PhabricatorIndexEngineExtension {
|
||
|
|
||
|
const EXTENSIONKEY = 'fulltext';
|
||
|
|
||
|
public function getExtensionName() {
|
||
|
return pht('Fulltext Engine');
|
||
|
}
|
||
|
|
||
|
public function shouldIndexObject($object) {
|
||
|
return ($object instanceof PhabricatorFulltextInterface);
|
||
|
}
|
||
|
|
||
|
public function indexObject(
|
||
|
PhabricatorIndexEngine $engine,
|
||
|
$object) {
|
||
|
|
||
|
$engine = $object->newFulltextEngine();
|
||
|
if (!$engine) {
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
$engine->setObject($object);
|
||
|
|
||
|
$engine->buildFulltextIndexes();
|
||
|
}
|
||
|
|
||
|
}
|