Skip to content

Create a content provider

Christian Wolf edited this page Jul 31, 2022 · 3 revisions

Some apps in Nextcloud are generating content that you might want to make search-able for users.
Full text search allows any developer to easily index this content and integrate a search bar to the app.
We will call 'Provider' (or 'Content Provider') the concept of feeding Full text search with content.

Note: The Provider can be integrated into your app or, with enough event dispatcher and hooks, be a standalone app. (like Files_FullTextSearch)

info.xml

To let Full text search knows about your Provider, add those line to your appinfo/info.xml

 	<fulltextsearch>
 		<provider>OCA\YourNameSpace\Provider\MyProvider</provider>
 	</fulltextsearch>

The index

MyProvider is a class that implements OCA\FullTextSearch\IFullTextSearchProvider

<?php

namespace OCA\YourNameSpace\Provider;

use OCP\FullTextSearch\IFullTextSearchProvider;

class MyProvider implements IFullTextSearchProvider {
   [...]
}

documentation on its way

The search

documentation on its way