Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F1599823
PhrictionSearchIndexer.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
PhrictionSearchIndexer.php
View Options
<?php
final
class
PhrictionSearchIndexer
extends
PhabricatorSearchDocumentIndexer
{
public
function
getIndexableObject
()
{
return
new
PhrictionDocument
();
}
protected
function
buildAbstractDocumentByPHID
(
$phid
)
{
$document
=
$this
->
loadDocumentByPHID
(
$phid
);
$content
=
id
(
new
PhrictionContent
())->
load
(
$document
->
getContentID
());
$document
->
attachContent
(
$content
);
$content
=
$document
->
getContent
();
$doc
=
new
PhabricatorSearchAbstractDocument
();
$doc
->
setPHID
(
$document
->
getPHID
());
$doc
->
setDocumentType
(
PhrictionDocumentPHIDType
::
TYPECONST
);
$doc
->
setDocumentTitle
(
$content
->
getTitle
());
// TODO: This isn't precisely correct, denormalize into the Document table?
$doc
->
setDocumentCreated
(
$content
->
getDateCreated
());
$doc
->
setDocumentModified
(
$content
->
getDateModified
());
$doc
->
addField
(
PhabricatorSearchField
::
FIELD_BODY
,
$content
->
getContent
());
$doc
->
addRelationship
(
PhabricatorSearchRelationship
::
RELATIONSHIP_AUTHOR
,
$content
->
getAuthorPHID
(),
PhabricatorPeopleUserPHIDType
::
TYPECONST
,
$content
->
getDateCreated
());
$doc
->
addRelationship
(
(
$document
->
getStatus
()
==
PhrictionDocumentStatus
::
STATUS_EXISTS
)
?
PhabricatorSearchRelationship
::
RELATIONSHIP_OPEN
:
PhabricatorSearchRelationship
::
RELATIONSHIP_CLOSED
,
$document
->
getPHID
(),
PhrictionDocumentPHIDType
::
TYPECONST
,
time
());
return
$doc
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, Jul 16, 9:15 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
359107
Default Alt Text
PhrictionSearchIndexer.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment