Nextcloud PHP API (master)

ISearchResult

Interface ISearchResult

When a search request is initiated, FullTextSearch will create a SearchResult object, based on this interface, containing the SearchRequest and the targeted Content Provider.

The object will be passed to the Search Platform, which will proceed to the search and fill the SearchResult object with results.

Then, the object will be passed to the targeted Content Provider that will improve the Search Results with detailed information.

Finally, the SearchResult is returned to the original search request.

Tags
since
15.0.0

Table of Contents

Methods

addAggregation()  : ISearchResult
Add an aggregation to the result.
addDocument()  : ISearchResult
Add an IIndexDocument as one of the result of the search request.
getAggregations()  : array<string|int, mixed>
Get all aggregations.
getDocuments()  : array<string|int, IIndexDocument>
Returns all result of the search request, in an array of IIndexDocument.
getProvider()  : IFullTextSearchProvider
Get the targeted Content Provider.
getRequest()  : ISearchRequest
Get the original SearchRequest.
setDocuments()  : ISearchResult
Set an array of IIndexDocument as the result of the search request.
setMaxScore()  : ISearchResult
Set the top score for the search request.
setRawResult()  : ISearchResult
Set the raw result of the request.
setTime()  : ISearchResult
Set the time spent by the request to perform the search.
setTimedOut()  : ISearchResult
Set to true if the request timed out.
setTotal()  : ISearchResult
Set the total number of results for the search request.

Methods

addAggregation()

Add an aggregation to the result.

public addAggregation(string $category, string $value, int $count) : ISearchResult
Parameters
$category : string
$value : string
$count : int
Tags
since
15.0.0
Return values
ISearchResult

getAggregations()

Get all aggregations.

public getAggregations(string $category) : array<string|int, mixed>
Parameters
$category : string
Tags
since
15.0.0
Return values
array<string|int, mixed>

getDocuments()

Returns all result of the search request, in an array of IIndexDocument.

public getDocuments() : array<string|int, IIndexDocument>
Tags
since
15.0.0
Return values
array<string|int, IIndexDocument>

setTotal()

Set the total number of results for the search request.

public setTotal(int $total) : ISearchResult

Used by pagination.

Parameters
$total : int
Tags
since
15.0.0
Return values
ISearchResult

        
On this page

Search results