Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101627354
20161130.search.02.rebuild.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
Wed, Feb 12, 05:41
Size
914 B
Mime Type
text/x-php
Expires
Fri, Feb 14, 05:41 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24201927
Attached To
rPH Phabricator
20161130.search.02.rebuild.php
View Options
<?php
$use_mysql
=
false
;
$services
=
PhabricatorSearchService
::
getAllServices
();
foreach
(
$services
as
$service
)
{
$engine
=
$service
->
getEngine
();
if
(
$engine
instanceof
PhabricatorMySQLFulltextStorageEngine
)
{
$use_mysql
=
true
;
}
}
if
(
$use_mysql
)
{
$field
=
new
PhabricatorSearchDocumentField
();
$conn
=
$field
->
establishConnection
(
'r'
);
// We're only going to require this if the index isn't empty: if you're on a
// fresh install, you don't have to do anything.
$any_documents
=
queryfx_one
(
$conn
,
'SELECT * FROM %T LIMIT 1'
,
$field
->
getTableName
());
if
(
$any_documents
)
{
try
{
id
(
new
PhabricatorConfigManualActivity
())
->
setActivityType
(
PhabricatorConfigManualActivity
::
TYPE_REINDEX
)
->
save
();
}
catch
(
AphrontDuplicateKeyQueryException
$ex
)
{
// If we've already noted that this activity is required, just move on.
}
}
}
Event Timeline
Log In to Comment