CirrusSearch
Elasticsearch-powered search for MediaWiki
Loading...
Searching...
No Matches
CirrusSearch\Search\InterleavedResultSet Class Reference
+ Inheritance diagram for CirrusSearch\Search\InterleavedResultSet:
+ Collaboration diagram for CirrusSearch\Search\InterleavedResultSet:

Public Member Functions

 __construct (CirrusSearchResultSet $nested, array $interleaved, array $teamA, array $teamB, $offset)
 
 getMetrics ()
 
 getOffset ()
 
 extractResults ()
 
 getElasticResponse ()
 
 getElasticaResultSet ()
 
 addInterwikiResults (CirrusSearchResultSet $res, $type, $interwiki)
 
 setRewrittenQuery (string $newQuery, $newQuerySnippet=null)
 
 count ()
 Count elements of an object https://php.net/manual/en/countable.count.php.
 
 numRows ()
 
 getTotalHits ()
 Some search modes return a total hit count for the query in the entire article database.
 
 hasRewrittenQuery ()
 Some search modes will run an alternative query that it thinks gives a better result than the provided search.
 
 getQueryAfterRewrite ()
 
 getQueryAfterRewriteSnippet ()
 
 hasSuggestion ()
 Some search modes return a suggested alternate term if there are no exact hits.
 
 getSuggestionQuery ()
 
 getSuggestionSnippet ()
 
 getInterwikiResults ( $type=self::SECONDARY_RESULTS)
 Return a result set of hits on other (multiple) wikis associated with this one.
 
 hasInterwikiResults ( $type=self::SECONDARY_RESULTS)
 Check if there are results on other wikis.
 
 searchContainedSyntax ()
 Did the search contain search syntax? If so, Special:Search won't offer the user a link to a create a page named by the search string because the name would contain the search syntax.
 
 hasMoreResults ()
 
 shrink ( $limit)
 
 extractTitles ()
 Extract all the titles in the result set.
 
 setSuggestionQuery (string $suggestionQuery, $suggestionSnippet=null)
 

Constructor & Destructor Documentation

◆ __construct()

CirrusSearch\Search\InterleavedResultSet::__construct ( CirrusSearchResultSet $nested,
array $interleaved,
array $teamA,
array $teamB,
$offset )
Parameters
CirrusSearchResultSet$nestedOriginal result set for team A (control)
CirrusSearchResult[]$interleavedInterleaved results
string[]$teamADocument id's belonging to team A
string[]$teamBDocument id's belonging to team B
int$offsetOffset to calculate next unused result in team A

Member Function Documentation

◆ addInterwikiResults()

CirrusSearch\Search\InterleavedResultSet::addInterwikiResults ( CirrusSearchResultSet $res,
$type,
$interwiki )
Parameters
CirrusSearchResultSet$res
int$typeone of searchresultset::* constants
string$interwiki

Implements CirrusSearch\Search\CirrusSearchResultSet.

◆ count()

CirrusSearch\Search\InterleavedResultSet::count ( )

Count elements of an object https://php.net/manual/en/countable.count.php.

Returns
int The custom count as integer.
Since
5.1.0

◆ extractResults()

CirrusSearch\Search\InterleavedResultSet::extractResults ( )
Returns
CirrusSearchResult[]

◆ extractTitles()

CirrusSearch\Search\InterleavedResultSet::extractTitles ( )

Extract all the titles in the result set.

Returns
Title[]

◆ getElasticaResultSet()

CirrusSearch\Search\InterleavedResultSet::getElasticaResultSet ( )
Returns
\Elastica\ResultSet|null

Implements CirrusSearch\Search\CirrusSearchResultSet.

◆ getElasticResponse()

CirrusSearch\Search\InterleavedResultSet::getElasticResponse ( )
Returns
Response|null

Implements CirrusSearch\Search\CirrusSearchResultSet.

◆ getInterwikiResults()

CirrusSearch\Search\InterleavedResultSet::getInterwikiResults ( $type = self::SECONDARY_RESULTS)

Return a result set of hits on other (multiple) wikis associated with this one.

Parameters
int$type
Returns
ISearchResultSet[]

◆ getMetrics()

CirrusSearch\Search\InterleavedResultSet::getMetrics ( )

◆ getOffset()

CirrusSearch\Search\InterleavedResultSet::getOffset ( )
Returns
int|null

◆ getQueryAfterRewrite()

CirrusSearch\Search\InterleavedResultSet::getQueryAfterRewrite ( )
Returns
string|null The search the query was internally rewritten to, or null when the result of the original query was returned.

◆ getQueryAfterRewriteSnippet()

CirrusSearch\Search\InterleavedResultSet::getQueryAfterRewriteSnippet ( )
Returns
string|null Same as self::getQueryAfterRewrite(), but in HTML and with changes highlighted. Null when the query was not rewritten.

◆ getSuggestionQuery()

CirrusSearch\Search\InterleavedResultSet::getSuggestionQuery ( )
Returns
string|null Suggested query, null if none

◆ getSuggestionSnippet()

CirrusSearch\Search\InterleavedResultSet::getSuggestionSnippet ( )
Returns
string HTML highlighted suggested query, '' if none

◆ getTotalHits()

CirrusSearch\Search\InterleavedResultSet::getTotalHits ( )

Some search modes return a total hit count for the query in the entire article database.

This may include pages in namespaces that would not be matched on the given settings.

Return null if no total hits number is supported.

Returns
int|null

◆ hasInterwikiResults()

CirrusSearch\Search\InterleavedResultSet::hasInterwikiResults ( $type = self::SECONDARY_RESULTS)

Check if there are results on other wikis.

Parameters
int$type
Returns
bool

◆ hasMoreResults()

CirrusSearch\Search\InterleavedResultSet::hasMoreResults ( )
Returns
bool True when there are more pages of search results available.

◆ hasRewrittenQuery()

CirrusSearch\Search\InterleavedResultSet::hasRewrittenQuery ( )

Some search modes will run an alternative query that it thinks gives a better result than the provided search.

Returns true if this has occurred.

Returns
bool

◆ hasSuggestion()

CirrusSearch\Search\InterleavedResultSet::hasSuggestion ( )

Some search modes return a suggested alternate term if there are no exact hits.

Returns true if there is one on this set.

Returns
bool

◆ numRows()

CirrusSearch\Search\InterleavedResultSet::numRows ( )
Returns
int

◆ searchContainedSyntax()

CirrusSearch\Search\InterleavedResultSet::searchContainedSyntax ( )

Did the search contain search syntax? If so, Special:Search won't offer the user a link to a create a page named by the search string because the name would contain the search syntax.

Returns
bool

◆ setRewrittenQuery()

CirrusSearch\Search\InterleavedResultSet::setRewrittenQuery ( string $newQuery,
$newQuerySnippet = null )
Parameters
string$newQuery
HtmlArmor | string | null$newQuerySnippet

Implements CirrusSearch\Search\CirrusSearchResultSet.

◆ setSuggestionQuery()

CirrusSearch\Search\InterleavedResultSet::setSuggestionQuery ( string $suggestionQuery,
$suggestionSnippet = null )
Parameters
string$suggestionQuery
HtmlArmor | string | null$suggestionSnippet

Implements CirrusSearch\Search\CirrusSearchResultSet.

◆ shrink()

CirrusSearch\Search\InterleavedResultSet::shrink ( $limit)
Parameters
int$limitShrink result set to $limit and flag if more results are available.

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