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

Implementation of algorithm 2, Team-Draft Interleaving, from F. More...

Public Member Functions

 __construct ( $searchTerm)
 
 interleave (CirrusSearchResultSet $a, CirrusSearchResultSet $b, $limit)
 

Static Public Member Functions

static interleaveResults ( $a, $b, $limit)
 Interleave two arrays using team draft interleaving.
 

Detailed Description

Implementation of algorithm 2, Team-Draft Interleaving, from F.

Radlinski, M. Kurup, and T. Joachims. How does clickthrough data reflect retrieval quality? In Proc 17th Intl. Conf. on Information and Knowledge Management. ACM New York, NY, USA, 2008.

Constructor & Destructor Documentation

◆ __construct()

CirrusSearch\Search\TeamDraftInterleaver::__construct ( $searchTerm)
Parameters
string$searchTermThe query provided by the user.

Member Function Documentation

◆ interleave()

CirrusSearch\Search\TeamDraftInterleaver::interleave ( CirrusSearchResultSet $a,
CirrusSearchResultSet $b,
$limit )
Parameters
CirrusSearchResultSet$aResults for team A
CirrusSearchResultSet$bResults for team B
int$limitMaximum number of results to return
Returns
CirrusSearchResultSet

◆ interleaveResults()

static CirrusSearch\Search\TeamDraftInterleaver::interleaveResults ( $a,
$b,
$limit )
static

Interleave two arrays using team draft interleaving.

Only public for unit tests. The id's used as keys in $a and $b must represent the same thing, to prevent duplicates in the returned results.

Parameters
mixed[]$aMap from id to anything in preferred order for team A
mixed[]$bMap from id to anything in preferred order for team B
int$limitMaximum number of results to interleave
Returns
mixed[] Four item array. first item being the values from $a and $b in the interleaved ordering, second the ids belonging to team A, third the ids belonging to team B, and finally the offset for the next page in $a.

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