Changeset View
Changeset View
Standalone View
Standalone View
src/applications/almanac/query/AlmanacServiceSearchEngine.php
Show All 20 Lines | final class AlmanacServiceSearchEngine | ||||
protected function buildQueryFromParameters(array $map) { | protected function buildQueryFromParameters(array $map) { | ||||
$query = $this->newQuery(); | $query = $this->newQuery(); | ||||
if ($map['match'] !== null) { | if ($map['match'] !== null) { | ||||
$query->withNameNgrams($map['match']); | $query->withNameNgrams($map['match']); | ||||
} | } | ||||
if ($map['names']) { | |||||
$query->withNames($map['names']); | |||||
} | |||||
if ($map['devicePHIDs']) { | |||||
$query->withDevicePHIDs($map['devicePHIDs']); | |||||
} | |||||
return $query; | return $query; | ||||
} | } | ||||
protected function buildCustomSearchFields() { | protected function buildCustomSearchFields() { | ||||
return array( | return array( | ||||
id(new PhabricatorSearchTextField()) | id(new PhabricatorSearchTextField()) | ||||
->setLabel(pht('Name Contains')) | ->setLabel(pht('Name Contains')) | ||||
->setKey('match') | ->setKey('match') | ||||
->setDescription(pht('Search for services by name substring.')), | ->setDescription(pht('Search for services by name substring.')), | ||||
id(new PhabricatorSearchStringListField()) | |||||
->setLabel(pht('Exact Names')) | |||||
->setKey('names') | |||||
->setDescription(pht('Search for services with specific names.')), | |||||
id(new PhabricatorPHIDsSearchField()) | |||||
->setLabel(pht('Devices')) | |||||
->setKey('devicePHIDs') | |||||
->setDescription( | |||||
pht('Search for services bound to particular devices.')), | |||||
); | ); | ||||
} | } | ||||
protected function getURI($path) { | protected function getURI($path) { | ||||
return '/almanac/service/'.$path; | return '/almanac/service/'.$path; | ||||
} | } | ||||
protected function getBuiltinQueryNames() { | protected function getBuiltinQueryNames() { | ||||
▲ Show 20 Lines • Show All 59 Lines • Show Last 20 Lines |