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 informations.
Finally, the SearchResult is returned to the original search request.
Tags
Table of Contents
- addAggregation() : ISearchResult
- Add an aggregation to the result.
- addDocument() : ISearchResult
- Add an IIndexDocument as one of the result of the search request.
- getAggregations() : array
- Get all aggregations.
- getDocuments() : \OCP\FullTextSearch\Model\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
Return values
ISearchResult —addDocument()
Add an IIndexDocument as one of the result of the search request.
public
addDocument(IIndexDocument $document) : ISearchResult
Parameters
- $document : IIndexDocument
Tags
Return values
ISearchResult —getAggregations()
Get all aggregations.
public
getAggregations(string $category) : array
Parameters
- $category : string
Tags
Return values
array —getDocuments()
Returns all result of the search request, in an array of IIndexDocument.
public
getDocuments() : \OCP\FullTextSearch\Model\IIndexDocument[]
Tags
Return values
\OCP\FullTextSearch\Model\IIndexDocument[] —getProvider()
Get the targeted Content Provider.
public
getProvider() : IFullTextSearchProvider
Tags
Return values
IFullTextSearchProvider —getRequest()
Get the original SearchRequest.
public
getRequest() : ISearchRequest
Tags
Return values
ISearchRequest —setDocuments()
Set an array of IIndexDocument as the result of the search request.
public
setDocuments(\OCP\FullTextSearch\Model\IIndexDocument[] $documents) : ISearchResult
Parameters
- $documents : \OCP\FullTextSearch\Model\IIndexDocument[]
Tags
Return values
ISearchResult —setMaxScore()
Set the top score for the search request.
public
setMaxScore(int $score) : ISearchResult
Parameters
- $score : int
Tags
Return values
ISearchResult —setRawResult()
Set the raw result of the request.
public
setRawResult(string $result) : ISearchResult
Parameters
- $result : string
Tags
Return values
ISearchResult —setTime()
Set the time spent by the request to perform the search.
public
setTime(int $time) : ISearchResult
Parameters
- $time : int
Tags
Return values
ISearchResult —setTimedOut()
Set to true if the request timed out.
public
setTimedOut(bool $timedOut) : ISearchResult
Parameters
- $timedOut : bool
Tags
Return values
ISearchResult —setTotal()
Set the total number of results for the search request.
public
setTotal(int $total) : ISearchResult
Used by pagination.
Parameters
- $total : int