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

Base class to represent a CirrusSearchResultSet Extensions willing to feed Cirrus with a CirrusSearchResultSet must extend this class. More...

+ Inheritance diagram for CirrusSearch\Search\BaseCirrusSearchResultSet:
+ Collaboration diagram for CirrusSearch\Search\BaseCirrusSearchResultSet:

Public Member Functions

 hasMoreResults ()
 
 setSuggestionQuery (string $suggestionQuery, $suggestionSnippet=null)
 
 shrink ( $limit)
 
 extractResults ()
 
 extractTitles ()
 Extract all the titles in the result set.
 
 addInterwikiResults (CirrusSearchResultSet $res, $type, $interwiki)
 
 getInterwikiResults ( $type=self::SECONDARY_RESULTS)
 
 hasInterwikiResults ( $type=self::SECONDARY_RESULTS)
 
 setRewrittenQuery (string $newQuery, $newQuerySnippet=null)
 
 hasRewrittenQuery ()
 
 getQueryAfterRewrite ()
 
 getQueryAfterRewriteSnippet ()
 
 hasSuggestion ()
 
 getSuggestionQuery ()
 
 getSuggestionSnippet ()
 
 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.
 
 getElasticResponse ()
 
- Public Member Functions inherited from CirrusSearch\Search\CirrusSearchResultSet
 getElasticaResultSet ()
 

Static Public Member Functions

static emptyResultSet ( $searchContainedSyntax=false)
 

Protected Member Functions

 transformOneResult (\Elastica\Result $result)
 
 getTitleHelper ()
 Useful to inject your own TitleHelper during tests.
 

Detailed Description

Base class to represent a CirrusSearchResultSet Extensions willing to feed Cirrus with a CirrusSearchResultSet must extend this class.

Member Function Documentation

◆ addInterwikiResults()

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

Implements CirrusSearch\Search\CirrusSearchResultSet.

◆ count()

CirrusSearch\Search\BaseCirrusSearchResultSet::count ( )
final

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

Returns
int The custom count as an integer.
Since
5.1.0

◆ emptyResultSet()

static CirrusSearch\Search\BaseCirrusSearchResultSet::emptyResultSet ( $searchContainedSyntax = false)
staticfinal
Parameters
bool$searchContainedSyntax
Returns
CirrusSearchResultSet an empty result set

◆ extractResults()

CirrusSearch\Search\BaseCirrusSearchResultSet::extractResults ( )
final
Returns
CirrusSearchResult[]|SearchResult[]

◆ extractTitles()

CirrusSearch\Search\BaseCirrusSearchResultSet::extractTitles ( )
final

Extract all the titles in the result set.

Returns
Title[]

◆ getElasticResponse()

CirrusSearch\Search\BaseCirrusSearchResultSet::getElasticResponse ( )
final
Returns
\Elastica\Response|null

Implements CirrusSearch\Search\CirrusSearchResultSet.

◆ getInterwikiResults()

CirrusSearch\Search\BaseCirrusSearchResultSet::getInterwikiResults ( $type = self::SECONDARY_RESULTS)
final
Parameters
int$type
Returns
\ISearchResultSet[]

◆ getQueryAfterRewrite()

CirrusSearch\Search\BaseCirrusSearchResultSet::getQueryAfterRewrite ( )
final
Returns
string|null

◆ getQueryAfterRewriteSnippet()

CirrusSearch\Search\BaseCirrusSearchResultSet::getQueryAfterRewriteSnippet ( )
final
Returns
HtmlArmor|string|null

◆ getSuggestionQuery()

CirrusSearch\Search\BaseCirrusSearchResultSet::getSuggestionQuery ( )
final
Returns
string|null

◆ getSuggestionSnippet()

CirrusSearch\Search\BaseCirrusSearchResultSet::getSuggestionSnippet ( )
final
Returns
string|null

◆ getTitleHelper()

CirrusSearch\Search\BaseCirrusSearchResultSet::getTitleHelper ( )
protected

Useful to inject your own TitleHelper during tests.

Returns
TitleHelper

◆ getTotalHits()

CirrusSearch\Search\BaseCirrusSearchResultSet::getTotalHits ( )
final

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\BaseCirrusSearchResultSet::hasInterwikiResults ( $type = self::SECONDARY_RESULTS)
final
Parameters
int$type
Returns
bool

◆ hasMoreResults()

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

◆ hasRewrittenQuery()

CirrusSearch\Search\BaseCirrusSearchResultSet::hasRewrittenQuery ( )
final
Returns
bool

◆ hasSuggestion()

CirrusSearch\Search\BaseCirrusSearchResultSet::hasSuggestion ( )
final
Returns
bool

◆ numRows()

CirrusSearch\Search\BaseCirrusSearchResultSet::numRows ( )
final
Returns
int

◆ setRewrittenQuery()

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

Implements CirrusSearch\Search\CirrusSearchResultSet.

◆ setSuggestionQuery()

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

Implements CirrusSearch\Search\CirrusSearchResultSet.

◆ shrink()

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

◆ transformOneResult()

CirrusSearch\Search\BaseCirrusSearchResultSet::transformOneResult ( \Elastica\Result $result)
abstractprotected
Parameters
\Elastica\Result$resultResult from search engine
Returns
CirrusSearchResult|null Elasticsearch result transformed into mediawiki search result object.

Reimplemented in CirrusSearch\Search\EmptySearchResultSet.


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