1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-16 20:02:40 +01:00
phorge-phorge/src/applications/search/engineextension/PhabricatorFulltextIndexEngineExtension.php

31 lines
579 B
PHP
Raw Normal View History

<?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();
}
}