Nextcloud PHP API (stable19)

IFullTextSearchManager

Interface IFullTextSearchManager

Should be used to manage FullTextSearch from the app that contains your Content Provider/Search Platform.

Tags
since
15.0.0

Table of Contents

addJavascriptAPI()  : mixed
Add the Javascript API in the navigation page of an app.
createIndex()  : IIndex
Create a new Index.
getIndex()  : IIndex
Retrieve an Index from the database, based on the Id of the Provider and the Id of the Document
isAvailable()  : bool
returns true is Full Text Search is available (app is present and Service are registered)
isProviderIndexed()  : bool
Check if the provider $providerId is already indexed.
registerIndexService()  : mixed
Register a IIndexService.
registerProviderService()  : mixed
Register a IProviderService.
registerSearchService()  : mixed
Register a ISearchService.
search()  : \OCP\FullTextSearch\Model\ISearchResult[]
Search using an array as request. If $userId is empty, will use the current session.
updateIndexes()  : mixed
Update an array of Index.
updateIndexesStatus()  : mixed
Update the status of an array of Index. status is a bit flag, setting $reset to true will reset the status to the value defined in the parameter.
updateIndexStatus()  : mixed
Update the status of an Index. status is a bitflag, setting $reset to true will reset the status to the value defined in the parameter.

Methods

addJavascriptAPI()

Add the Javascript API in the navigation page of an app.

public addJavascriptAPI() : mixed

Needed to replace the default search.

Tags
since
15.0.0
Return values
mixed

createIndex()

Create a new Index.

public createIndex(string $providerId, string $documentId, string $userId, int $status) : IIndex

This method must be called when a new document is created.

Parameters
$providerId : string
$documentId : string
$userId : string
$status : int
Tags
since
15.0.0
Return values
IIndex

getIndex()

Retrieve an Index from the database, based on the Id of the Provider and the Id of the Document

public getIndex(string $providerId, string $documentId) : IIndex
Parameters
$providerId : string
$documentId : string
Tags
since
15.0.0
Return values
IIndex

isAvailable()

returns true is Full Text Search is available (app is present and Service are registered)

public isAvailable() : bool
Tags
since
16.0.0
Return values
bool

isProviderIndexed()

Check if the provider $providerId is already indexed.

public isProviderIndexed(string $providerId) : bool
Parameters
$providerId : string
Tags
since
15.0.0
Return values
bool

Search using an array as request. If $userId is empty, will use the current session.

public search(array $request[, string $userId = '' ]) : \OCP\FullTextSearch\Model\ISearchResult[]
Parameters
$request : array
$userId : string = ''
Tags
see
ISearchService::generateSearchRequest
since
15.0.0
Return values
\OCP\FullTextSearch\Model\ISearchResult[]

updateIndexes()

Update an array of Index.

public updateIndexes(\OCP\FullTextSearch\Model\IIndex[] $indexes) : mixed
Parameters
$indexes : \OCP\FullTextSearch\Model\IIndex[]
Tags
since
15.0.0
Return values
mixed

updateIndexesStatus()

Update the status of an array of Index. status is a bit flag, setting $reset to true will reset the status to the value defined in the parameter.

public updateIndexesStatus(string $providerId, array $documentIds, int $status[, bool $reset = false ]) : mixed
Parameters
$providerId : string
$documentIds : array
$status : int
$reset : bool = false
Tags
since
15.0.0
Return values
mixed

updateIndexStatus()

Update the status of an Index. status is a bitflag, setting $reset to true will reset the status to the value defined in the parameter.

public updateIndexStatus(string $providerId, string $documentId, int $status[, bool $reset = false ]) : mixed
Parameters
$providerId : string
$documentId : string
$status : int
$reset : bool = false
Tags
since
15.0.0
Return values
mixed

Search results