Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\Api\EntityTermSearchHelper Class Reference

Helper class to search for entities. More...

+ Inheritance diagram for Wikibase\Repo\Api\EntityTermSearchHelper:
+ Collaboration diagram for Wikibase\Repo\Api\EntityTermSearchHelper:

Public Member Functions

 __construct (ConfigurableTermSearchInteractor $termSearchInteractor)
 
 getRankedSearchResults ( $text, $languageCode, $entityType, $limit, $strictLanguage)
 Gets exact matches.
 

Private Member Functions

 mergeSearchResults (array $searchResults, array $newSearchResults, $limit)
 
 searchEntities ( $text, $languageCode, $entityType, $limit, $prefixSearch, $strictLanguage)
 Wrapper around TermSearchInteractor::searchForEntities.
 

Private Attributes

 $termSearchInteractor
 

Detailed Description

Helper class to search for entities.

Author
Bene* < benes.nosp@m.tar..nosp@m.wikim.nosp@m.edia.nosp@m.@gmai.nosp@m.l.co.nosp@m.m >

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Api\EntityTermSearchHelper::__construct ( ConfigurableTermSearchInteractor  $termSearchInteractor)
Parameters
ConfigurableTermSearchInteractor$termSearchInteractor

Member Function Documentation

◆ getRankedSearchResults()

Wikibase\Repo\Api\EntityTermSearchHelper::getRankedSearchResults (   $text,
  $languageCode,
  $entityType,
  $limit,
  $strictLanguage 
)

Gets exact matches.

If there are not enough exact matches, it gets prefixed matches.

Parameters
string$text
string$languageCode
string$entityType
int$limit
bool$strictLanguage
Returns
TermSearchResult[] Key: string Serialized EntityId

Implements Wikibase\Repo\Api\EntitySearchHelper.

◆ mergeSearchResults()

Wikibase\Repo\Api\EntityTermSearchHelper::mergeSearchResults ( array  $searchResults,
array  $newSearchResults,
  $limit 
)
private
Parameters
TermSearchResult[]$searchResults
TermSearchResult[]$newSearchResults
int$limit
Returns
TermSearchResult[]

◆ searchEntities()

Wikibase\Repo\Api\EntityTermSearchHelper::searchEntities (   $text,
  $languageCode,
  $entityType,
  $limit,
  $prefixSearch,
  $strictLanguage 
)
private

Wrapper around TermSearchInteractor::searchForEntities.

See also
TermSearchInteractor::searchForEntities
Parameters
string$text
string$languageCode
string$entityType
int$limit
bool$prefixSearch
bool$strictLanguage
Returns
TermSearchResult[]

Member Data Documentation

◆ $termSearchInteractor

Wikibase\Repo\Api\EntityTermSearchHelper::$termSearchInteractor
private

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