ISearchResult

interface OCP\FullTextSearch\Model\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.
Source:lib/public/FullTextSearch/Model/ISearchResult.php#49

Methods

public OCP\FullTextSearch\Model\ISearchResult::getRequest()
Get the original SearchRequest.
Source:lib/public/FullTextSearch/Model/ISearchResult.php#61
See:\OCP\FullTextSearch\Model\ISearchRequest
Since:15.0.0
Returns:\OCP\FullTextSearch\Model\ISearchRequest
public OCP\FullTextSearch\Model\ISearchResult::getProvider()
Get the targeted Content Provider.
Source:lib/public/FullTextSearch/Model/ISearchResult.php#70
Since:15.0.0
Returns:\OCP\FullTextSearch\IFullTextSearchProvider
public OCP\FullTextSearch\Model\ISearchResult::addDocument($document)
Add an IIndexDocument as one of the result of the search request.
Source:

lib/public/FullTextSearch/Model/ISearchResult.php#82

Parameters:
Since:

15.0.0

Returns:

\OCP\FullTextSearch\Model\ISearchResult

public OCP\FullTextSearch\Model\ISearchResult::getDocuments()
Returns all result of the search request, in an array of IIndexDocument.
Source:lib/public/FullTextSearch/Model/ISearchResult.php#91
Since:15.0.0
Returns:\OCP\FullTextSearch\Model\IIndexDocument[]
public OCP\FullTextSearch\Model\ISearchResult::setDocuments($documents)
Set an array of IIndexDocument as the result of the search request.
Source:

lib/public/FullTextSearch/Model/ISearchResult.php#102

Parameters:
Since:

15.0.0

Returns:

\OCP\FullTextSearch\Model\ISearchResult

public OCP\FullTextSearch\Model\ISearchResult::addAggregation($category, $value, $count)
Add an aggregation to the result.
Source:

lib/public/FullTextSearch/Model/ISearchResult.php#116

Parameters:
  • $category (string)
  • $value (string)
  • $count (int)
Since:

15.0.0

Returns:

\OCP\FullTextSearch\Model\ISearchResult

public OCP\FullTextSearch\Model\ISearchResult::getAggregations($category)
Get all aggregations.
Source:

lib/public/FullTextSearch/Model/ISearchResult.php#127

Parameters:
  • $category (string)
Since:

15.0.0

Returns:

array

public OCP\FullTextSearch\Model\ISearchResult::setRawResult($result)
Set the raw result of the request.
Source:

lib/public/FullTextSearch/Model/ISearchResult.php#139

Parameters:
  • $result (string)
Since:

15.0.0

Returns:

\OCP\FullTextSearch\Model\ISearchResult

public OCP\FullTextSearch\Model\ISearchResult::setTotal($total)
Set the total number of results for the search request.
Used by pagination.
Source:

lib/public/FullTextSearch/Model/ISearchResult.php#152

Parameters:
  • $total (int)
Since:

15.0.0

Returns:

\OCP\FullTextSearch\Model\ISearchResult

public OCP\FullTextSearch\Model\ISearchResult::setMaxScore($score)
Set the top score for the search request.
Source:

lib/public/FullTextSearch/Model/ISearchResult.php#164

Parameters:
  • $score (int)
Since:

15.0.0

Returns:

\OCP\FullTextSearch\Model\ISearchResult

public OCP\FullTextSearch\Model\ISearchResult::setTime($time)
Set the time spent by the request to perform the search.
Source:

lib/public/FullTextSearch/Model/ISearchResult.php#176

Parameters:
  • $time (int)
Since:

15.0.0

Returns:

\OCP\FullTextSearch\Model\ISearchResult

public OCP\FullTextSearch\Model\ISearchResult::setTimedOut($timedOut)
Set to true if the request timed out.
Source:

lib/public/FullTextSearch/Model/ISearchResult.php#188

Parameters:
  • $timedOut (bool)
Since:

15.0.0

Returns:

\OCP\FullTextSearch\Model\ISearchResult