Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99285185
PhabricatorProjectFulltextEngine.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 23, 02:14
Size
1 KB
Mime Type
text/x-php
Expires
Sat, Jan 25, 02:14 (2 d)
Engine
blob
Format
Raw Data
Handle
23762137
Attached To
rPH Phabricator
PhabricatorProjectFulltextEngine.php
View Options
<?php
final
class
PhabricatorProjectFulltextEngine
extends
PhabricatorFulltextEngine
{
protected
function
buildAbstractDocument
(
PhabricatorSearchAbstractDocument
$document
,
$object
)
{
$project
=
$object
;
$viewer
=
$this
->
getViewer
();
// Reload the project to get slugs.
$project
=
id
(
new
PhabricatorProjectQuery
())
->
withIDs
(
array
(
$project
->
getID
()))
->
setViewer
(
$viewer
)
->
needSlugs
(
true
)
->
executeOne
();
$project
->
updateDatasourceTokens
();
$slugs
=
array
();
foreach
(
$project
->
getSlugs
()
as
$slug
)
{
$slugs
[]
=
$slug
->
getSlug
();
}
$body
=
implode
(
"
\n
"
,
$slugs
);
$document
->
setDocumentTitle
(
$project
->
getDisplayName
())
->
addField
(
PhabricatorSearchDocumentFieldType
::
FIELD_BODY
,
$body
);
$document
->
addRelationship
(
$project
->
isArchived
()
?
PhabricatorSearchRelationship
::
RELATIONSHIP_CLOSED
:
PhabricatorSearchRelationship
::
RELATIONSHIP_OPEN
,
$project
->
getPHID
(),
PhabricatorProjectProjectPHIDType
::
TYPECONST
,
PhabricatorTime
::
getNow
());
}
}
Event Timeline
Log In to Comment