Page MenuHomePhorge

PhabricatorSearchEngine.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

PhabricatorSearchEngine.php

<?php
/**
* Base class for Phabricator search engine providers. Each engine must offer
* three capabilities: indexing, searching, and reconstruction (this can be
* stubbed out if an engine can't reasonably do it, it is used for debugging).
*/
abstract class PhabricatorSearchEngine {
/**
* Update the index for an abstract document.
*
* @param PhabricatorSearchAbstractDocument Document to update.
* @return void
*/
abstract public function reindexAbstractDocument(
PhabricatorSearchAbstractDocument $document);
/**
* 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.
*
* @param phid Document PHID to reconstruct.
* @return PhabricatorSearchAbstractDocument Abstract document.
*/
abstract public function reconstructDocument($phid);
/**
* Execute a search query.
*
* @param PhabricatorSavedQuery A query to execute.
* @return list A list of matching PHIDs.
*/
abstract public function executeSearch(PhabricatorSavedQuery $query);
/**
* Does the search index exist?
*
* @return bool
*/
abstract public function indexExists();
/**
* Is the index in a usable state?
*
* @return bool
*/
public function indexIsSane() {
return $this->indexExists();
}
/**
* Do any sort of setup for the search index
*
* @return void
*/
public function initIndex() {}
}

File Metadata

Mime Type
text/x-php
Expires
Mon, May 5, 7:18 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
70565
Default Alt Text
PhabricatorSearchEngine.php (1 KB)

Event Timeline