ISearchResult
in
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
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
Return values
ISearchResultaddDocument()
Add an IIndexDocument as one of the result of the search request.
public
addDocument(IIndexDocument $document) : ISearchResult
Parameters
- $document : IIndexDocument
Tags
Return values
ISearchResultgetAggregations()
Get all aggregations.
public
getAggregations(string $category) : array<string|int, mixed>
Parameters
- $category : string
Tags
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
Return values
array<string|int, IIndexDocument>getProvider()
Get the targeted Content Provider.
public
getProvider() : IFullTextSearchProvider
Tags
Return values
IFullTextSearchProvidergetRequest()
Get the original SearchRequest.
public
getRequest() : ISearchRequest
Tags
Return values
ISearchRequestsetDocuments()
Set an array of IIndexDocument as the result of the search request.
public
setDocuments(array<string|int, IIndexDocument> $documents) : ISearchResult
Parameters
- $documents : array<string|int, IIndexDocument>
Tags
Return values
ISearchResultsetMaxScore()
Set the top score for the search request.
public
setMaxScore(int $score) : ISearchResult
Parameters
- $score : int
Tags
Return values
ISearchResultsetRawResult()
Set the raw result of the request.
public
setRawResult(string $result) : ISearchResult
Parameters
- $result : string
Tags
Return values
ISearchResultsetTime()
Set the time spent by the request to perform the search.
public
setTime(int $time) : ISearchResult
Parameters
- $time : int
Tags
Return values
ISearchResultsetTimedOut()
Set to true if the request timed out.
public
setTimedOut(bool $timedOut) : ISearchResult
Parameters
- $timedOut : bool
Tags
Return values
ISearchResultsetTotal()
Set the total number of results for the search request.
public
setTotal(int $total) : ISearchResult
Used by pagination.
Parameters
- $total : int