Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92733313
PhrictionDocumentFulltextEngine.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
Sat, Nov 23, 06:15
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Nov 25, 06:15 (1 d, 20 h)
Engine
blob
Format
Raw Data
Handle
22500144
Attached To
rPH Phabricator
PhrictionDocumentFulltextEngine.php
View Options
<?php
final
class
PhrictionDocumentFulltextEngine
extends
PhabricatorFulltextEngine
{
protected
function
buildAbstractDocument
(
PhabricatorSearchAbstractDocument
$document
,
$object
)
{
$wiki
=
id
(
new
PhrictionDocumentQuery
())
->
setViewer
(
$this
->
getViewer
())
->
withPHIDs
(
array
(
$document
->
getPHID
()))
->
needContent
(
true
)
->
executeOne
();
$content
=
$wiki
->
getContent
();
$document
->
setDocumentTitle
(
$content
->
getTitle
());
// TODO: These are not quite correct, but we don't currently store the
// proper dates in a way that's easy to get to.
$document
->
setDocumentCreated
(
$content
->
getDateCreated
())
->
setDocumentModified
(
$content
->
getDateModified
());
$document
->
addField
(
PhabricatorSearchDocumentFieldType
::
FIELD_BODY
,
$content
->
getContent
());
$document
->
addRelationship
(
PhabricatorSearchRelationship
::
RELATIONSHIP_AUTHOR
,
$content
->
getAuthorPHID
(),
PhabricatorPeopleUserPHIDType
::
TYPECONST
,
$content
->
getDateCreated
());
$document
->
addRelationship
(
(
$wiki
->
getStatus
()
==
PhrictionDocumentStatus
::
STATUS_EXISTS
)
?
PhabricatorSearchRelationship
::
RELATIONSHIP_OPEN
:
PhabricatorSearchRelationship
::
RELATIONSHIP_CLOSED
,
$wiki
->
getPHID
(),
PhrictionDocumentPHIDType
::
TYPECONST
,
PhabricatorTime
::
getNow
());
}
}
Event Timeline
Log In to Comment