public function getEngineIdentifier()
Return a unique, nonempty string which identifies this storage engine.
| string | Unique string for this engine, max length 32. |
public function getEnginePriority()
Prioritize this engine relative to other engines.
Engines with a smaller priority number get an opportunity to write files first. Generally, lower-latency filestores should have lower priority numbers, and higher-latency filestores should have higher priority numbers. Setting priority to approximately the number of milliseconds of read latency will generally produce reasonable results.
In conjunction with filesize limits, the goal is to store small files like profile images, thumbnails, and text snippets in lower-latency engines, and store large files in higher-capacity engines.
| float | Engine priority. |
public function isEnabled()
Return true if the engine is currently writable.
Engines that are disabled or missing configuration should return false to prevent new writes. If writes were made with this engine in the past, the application may still try to perform reads.
| bool | True if this engine can support new writes. |
public function reindexAbstractDocument($doc)
Update the index for an abstract document.
| PhabricatorSearchAbstractDocument | $document | Document to update. |
| void |
public function reconstructDocument($phid)
Reconstruct the document for a given PHID. This is used for debugging and does not need to be perfect if it is unreasonable to implement it.
| phid | $phid | Document PHID to reconstruct. |
| PhabricatorSearchAbstractDocument | Abstract document. |
public function executeSearch($query)
Execute a search query.
| PhabricatorSavedQuery | $query | A query to execute. |
| list | A list of matching PHIDs. |
public function indexExists()
Does the search index exist?
| bool |
public function indexIsSane()
Is the index in a usable state?
| bool |
public function initIndex()
Do any sort of setup for the search index.
| void |
public static function loadAllEngines()Inherited
| wild |
public static function loadActiveEngines()Inherited
| wild |
public static function loadEngine()Inherited
| wild |
public function __construct()
| this | //Implicit.// |
public function setURI($uri)
| $uri |
| wild |
public function setIndex($index)
| $index |
| wild |
public function setTimeout($timeout)
| $timeout |
| wild |
public function getURI()
| wild |
public function getIndex()
| wild |
public function getTimeout()
| wild |
private function buildSpec($query)
| PhabricatorSavedQuery | $query |
| wild |
private function getIndexConfiguration()
| wild |
private function check($actual, $required)
Recursively check if two Elasticsearch configuration arrays are equal
| $actual | $actual | |
| $required | $required | array |
| bool |
private static function normalizeConfigValue($value)
Normalize a config value for comparison. Elasticsearch accepts all kinds of config values but it tends to throw back 'true' for true and 'false' for false so we normalize everything. Sometimes, oddly, it'll throw back false for false....
| mixed | $value | config value |
| mixed | value normalized |
private function executeRequest($path, $data, $method)
| $path | ||
| array | $data | |
| $method |
| wild |