Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F104852823
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, Mar 12, 21:55
Size
817 B
Mime Type
text/x-php
Expires
Fri, Mar 14, 21:55 (2 d)
Engine
blob
Format
Raw Data
Handle
24864811
Attached To
rPH Phabricator
20161130.search.02.rebuild.php
View Options
<?php
$search_engine
=
PhabricatorFulltextStorageEngine
::
loadEngine
();
$use_mysql
=
(
$search_engine
instanceof
PhabricatorMySQLFulltextStorageEngine
);
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