* OCA\YourApp\YourSearchPlatform * * * Multiple Search Platform can be defined in a single app. * * @since 15.0.0 * */ interface IFullTextSearchPlatform { /** * Must returns a unique Id used to identify the Search Platform. * Id must contains only alphanumeric chars, with no space. * * @since 15.0.0 * * @return string */ public function getId(): string; /** * Must returns a descriptive name of the Search Platform. * This is used mainly in the admin settings page to display the list of * available Search Platform * * @since 15.0.0 * * @return string */ public function getName(): string; /** * should returns the current configuration of the Search Platform. * This is used to display the configuration when using the * ./occ fulltextsearch:check command line. * * @since 15.0.0 * * @return array */ public function getConfiguration(): array; /** * Set the wrapper of the currently executed process. * Because the index process can be long and heavy, and because errors can * be encountered during the process, the IRunner is a wrapper that allow the * Search Platform to communicate with the process initiated by * FullTextSearch. * * The IRunner is coming with some methods so the Search Platform can * returns important information and errors to be displayed to the admin. * * @since 15.0.0 * * @param IRunner $runner */ public function setRunner(IRunner $runner); /** * Called when FullTextSearch is loading your Search Platform. * * @since 15.0.0 */ public function loadPlatform(); /** * Called to check that your Search Platform is correctly configured and that * This is also the right place to check that the Search Service is available. * * @since 15.0.0 * * @return bool */ public function testPlatform(): bool; /** * Called before an index is initiated. * Best place to initiate some stuff on the Search Server (mapping, ...) * * @since 15.0.0 */ public function initializeIndex(); /** * Reset the indexes for a specific providerId. * $providerId can be 'all' if it is a global reset. * * @since 15.0.0 * * @param string $providerId */ public function resetIndex(string $providerId); /** * Deleting some IIndex, sent in an array * * @see IIndex * * @since 15.0.0 * * @param IIndex[] $indexes */ public function deleteIndexes(array $indexes); /** * Indexing a document. * * @see IndexDocument * * @since 15.0.0 * * @param IIndexDocument $document * * @return IIndex */ public function indexDocument(IIndexDocument $document): IIndex; /** * Searching documents, ISearchResult should be updated with the result of * the search. * * @since 15.0.0 * * @param ISearchResult $result * @param IDocumentAccess $access */ public function searchRequest(ISearchResult $result, IDocumentAccess $access); /** * Return a document based on its Id and the Provider. * This is used when an admin execute ./occ fulltextsearch:document:platform * * @since 15.0.0 * * @param string $providerId * @param string $documentId * * @return IIndexDocument */ public function getDocument(string $providerId, string $documentId): IIndexDocument; }