Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F98106886
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, Jan 9, 20:50
Size
1 KB
Mime Type
text/x-php
Expires
Sat, Jan 11, 20:50 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23506613
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
shouldIndexFulltextObject
(
$object
)
{
return
(
$object
instanceof
PhabricatorCustomFieldInterface
);
}
public
function
indexFulltextObject
(
$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