Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F110106482
PhabricatorCustomFieldFulltextEngineExtension.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Apr 24, 18:16
Size
1 KB
Mime Type
text/x-php
Expires
Sat, Apr 26, 18:16 (2 d)
Engine
blob
Format
Raw Data
Handle
25786553
Attached To
rPH Phabricator
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
);
}
}
Event Timeline
Log In to Comment