IProvider¶
-
interface
OCP\Search\
IProvider
¶ - Interface for search providersThese providers will be implemented in apps, so they can participate in theglobal search results of Nextcloud. If an app provides more than one type ofresource, e.g. contacts and address books in Nextcloud Contacts, it shouldregister one provider per group.
Source: lib/public/Search/IProvider.php#43
Methods¶
-
public
OCP\Search\IProvider::
getId
()¶ - Get the unique ID of this search providerIdeally this should be the app name or an identifier identified with theapp name, especially if the app registers more than one provider.Example: ‘mail’, ‘mail_recipients’, ‘files_sharing’
Source: lib/public/Search/IProvider.php#57 Returns: string Since: 20.0.0
-
public
OCP\Search\IProvider::
getName
()¶ - Get the translated name of this search providerExample: ‘Mail’, ‘Contacts’...
Source: lib/public/Search/IProvider.php#68 Returns: string Since: 20.0.0
-
public
OCP\Search\IProvider::
getOrder
($route, $routeParameters)¶ - Get the search provider orderThe lower the int, the higher it will be sorted (0 will be before 10)
Source: Parameters: - $route (string) the route the user is currently at, e.g. files.view.index
- $routeParameters (array) the parameters of the route the user is currently at, e.g. [fileId = 982, dir = “/”]
Returns: int
Since: 20.0.0
-
public
OCP\Search\IProvider::
search
($user, $query)¶ - Find matching search entries in an appSearch results can either be a complete list of all the matches the app canfind, or ideally a paginated result set where more data can be fetched ondemand. To be able to tell where the next offset starts the search uses“cursors” which are a property of the last result entry. E.g. search resultsthat show most recent entries first can look for entries older than the lastone of the first result set. This approach was chosen over a numeric limit/offset approach as the offset moves as new data comes in. The cursor isresistant to these changes and will still show results without overlaps orgaps.for the concept of cursors.Implementations that return result pages have to adhere to the limitproperty of a search query.
Source: Parameters: - $user (
OCP\IUser
) - $query (
OCP\Search\ISearchQuery
)
Returns: Since: 20.0.0
- $user (