CirrusSearch
Elasticsearch-powered search for MediaWiki
Loading...
Searching...
No Matches
CirrusSearch\Search\CompletionResultsCollector Class Reference

Collect results from multiple result sets. More...

Public Member Functions

 __construct ( $limit, $offset=0, $bannedIds=[])
 
 collect (SearchSuggestion $suggestion, $profileName, $index)
 Collect a doc if possible.
 
 isFull ()
 Test whether the collector is full.
 
 size ()
 Number of suggestions collected.
 
 logAndGetSet (CompletionRequestLog $log)
 Return the set of suggestions collected so far and log its states to CompletionRequestLog.
 
 getMinScore ()
 

Detailed Description

Collect results from multiple result sets.

Constructor & Destructor Documentation

◆ __construct()

CirrusSearch\Search\CompletionResultsCollector::__construct ( $limit,
$offset = 0,
$bannedIds = [] )
Parameters
int$limitnumber of results we want to display
int$offset
int[]$bannedIdsSet of id's to never return

Member Function Documentation

◆ collect()

CirrusSearch\Search\CompletionResultsCollector::collect ( SearchSuggestion $suggestion,
$profileName,
$index )

Collect a doc if possible.

The doc will be collected if the capacity is not yet reached or if its score is better than a suggestion already collected.

Parameters
SearchSuggestion$suggestion
string$profileName
string$index
Returns
bool true if the doc was added false otherwise

◆ getMinScore()

CirrusSearch\Search\CompletionResultsCollector::getMinScore ( )
Returns
float|null

◆ isFull()

CirrusSearch\Search\CompletionResultsCollector::isFull ( )

Test whether the collector is full.

Returns
bool true if it's full

◆ logAndGetSet()

CirrusSearch\Search\CompletionResultsCollector::logAndGetSet ( CompletionRequestLog $log)

Return the set of suggestions collected so far and log its states to CompletionRequestLog.

Parameters
CompletionRequestLog$log
Returns
SearchSuggestionSet

◆ size()

CirrusSearch\Search\CompletionResultsCollector::size ( )

Number of suggestions collected.

Returns
int

The documentation for this class was generated from the following file: