Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96195629
PhabricatorElasticSetupCheck.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
Mon, Dec 23, 16:15
Size
1 KB
Mime Type
text/x-php
Expires
Wed, Dec 25, 16:15 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23142014
Attached To
rPH Phabricator
PhabricatorElasticSetupCheck.php
View Options
<?php
final
class
PhabricatorElasticSetupCheck
extends
PhabricatorSetupCheck
{
public
function
getDefaultGroup
()
{
return
self
::
GROUP_OTHER
;
}
protected
function
executeChecks
()
{
if
(
PhabricatorDefaultSearchEngineSelector
::
shouldUseElasticSearch
())
{
$engine
=
PhabricatorSearchEngineSelector
::
newSelector
()->
newEngine
();
if
(!
$engine
->
indexExists
())
{
$summary
=
pht
(
'You enabled Elasticsearch but the index does not exist.'
);
$message
=
pht
(
'You likely enabled search.elastic.host without creating the '
.
'index. Run `./bin/search init` to correct the index.'
);
$this
->
newIssue
(
'elastic.missing-index'
)
->
setName
(
pht
(
'Elasticsearch index Not Found'
))
->
setSummary
(
$summary
)
->
setMessage
(
$message
)
->
addRelatedPhabricatorConfig
(
'search.elastic.host'
);
}
else
if
(!
$engine
->
indexIsSane
())
{
$summary
=
pht
(
'Elasticsearch index exists but needs correction.'
);
$message
=
pht
(
'Either the Phabricator schema for Elasticsearch has changed '
.
'or Elasticsearch created the index automatically. Run '
.
'`./bin/search init` to correct the index.'
);
$this
->
newIssue
(
'elastic.broken-index'
)
->
setName
(
pht
(
'Elasticsearch index Incorrect'
))
->
setSummary
(
$summary
)
->
setMessage
(
$message
);
}
}
}
}
Event Timeline
Log In to Comment