Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F452671
PhabricatorFulltextEngine.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
PhabricatorFulltextEngine.php
View Options
<?php
abstract
class
PhabricatorFulltextEngine
extends
Phobject
{
private
$object
;
public
function
setObject
(
$object
)
{
$this
->
object
=
$object
;
return
$this
;
}
public
function
getObject
()
{
return
$this
->
object
;
}
protected
function
getViewer
()
{
return
PhabricatorUser
::
getOmnipotentUser
();
}
abstract
protected
function
buildAbstractDocument
(
PhabricatorSearchAbstractDocument
$document
,
$object
);
final
public
function
buildFulltextIndexes
()
{
$object
=
$this
->
getObject
();
$extensions
=
PhabricatorFulltextEngineExtension
::
getAllExtensions
();
$enrich_extensions
=
array
();
$index_extensions
=
array
();
foreach
(
$extensions
as
$key
=>
$extension
)
{
if
(
$extension
->
shouldEnrichFulltextObject
(
$object
))
{
$enrich_extensions
[]
=
$extension
;
}
if
(
$extension
->
shouldIndexFulltextObject
(
$object
))
{
$index_extensions
[]
=
$extension
;
}
}
$document
=
$this
->
newAbstractDocument
(
$object
);
$this
->
buildAbstractDocument
(
$document
,
$object
);
foreach
(
$enrich_extensions
as
$extension
)
{
$extension
->
enrichFulltextObject
(
$object
,
$document
);
}
foreach
(
$index_extensions
as
$extension
)
{
$extension
->
indexFulltextObject
(
$object
,
$document
);
}
PhabricatorSearchService
::
reindexAbstractDocument
(
$document
);
}
protected
function
newAbstractDocument
(
$object
)
{
$phid
=
$object
->
getPHID
();
return
id
(
new
PhabricatorSearchAbstractDocument
())
->
setPHID
(
$phid
)
->
setDocumentType
(
phid_get_type
(
$phid
));
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 5, 12:57 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
68953
Default Alt Text
PhabricatorFulltextEngine.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment