Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F452487
PhabricatorCustomFieldFulltextEngineExtension.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
PhabricatorCustomFieldFulltextEngineExtension.php
View Options
<?php
final
class
PhabricatorCustomFieldFulltextEngineExtension
extends
PhabricatorFulltextEngineExtension
{
const
EXTENSIONKEY
=
'customfield.fields'
;
public
function
getExtensionName
()
{
return
pht
(
'Custom Fields'
);
}
public
function
shouldEnrichFulltextObject
(
$object
)
{
return
(
$object
instanceof
PhabricatorCustomFieldInterface
);
}
public
function
enrichFulltextObject
(
$object
,
PhabricatorSearchAbstractDocument
$document
)
{
// Rebuild the ApplicationSearch indexes. These are internal and not part
// of the fulltext search, but putting them in this workflow allows users
// to use the same tools to rebuild the indexes, which is easy to
// understand.
$field_list
=
PhabricatorCustomField
::
getObjectFields
(
$object
,
PhabricatorCustomField
::
ROLE_DEFAULT
);
$field_list
->
setViewer
(
$this
->
getViewer
());
$field_list
->
readFieldsFromStorage
(
$object
);
// Rebuild ApplicationSearch indexes.
$field_list
->
rebuildIndexes
(
$object
);
// Rebuild global search indexes.
$field_list
->
updateAbstractDocument
(
$document
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 5, 12:38 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
68837
Default Alt Text
PhabricatorCustomFieldFulltextEngineExtension.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment