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

EntitySearchHelper decorator that adds an entity concept URI to the TermSearchResult meta data if not already set. More...

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

Public Member Functions

 __construct (EntitySearchHelper $searchHelper, EntitySourceLookup $entitySourceLookup)
 
 getRankedSearchResults ( $text, $languageCode, $entityType, $limit, $strictLanguage, ?string $profileContext)
 Get entities matching the search term.
 

Public Attributes

const CONCEPTURI_META_DATA_KEY = TermSearchResult::CONCEPTURI_META_DATA_KEY
 

Private Member Functions

 getConceptUri (EntityId $entityId)
 
 getConceptBaseUri (EntityId $entityId)
 

Private Attributes

 $searchHelper
 
 $entitySourceLookup
 

Detailed Description

EntitySearchHelper decorator that adds an entity concept URI to the TermSearchResult meta data if not already set.

This works in conjunction with ApiEntitySearchHelper for federated properties that already includes the concept URI in the metadata.

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Api\ConceptUriSearchHelper::__construct ( EntitySearchHelper $searchHelper,
EntitySourceLookup $entitySourceLookup )

Member Function Documentation

◆ getConceptBaseUri()

Wikibase\Repo\Api\ConceptUriSearchHelper::getConceptBaseUri ( EntityId $entityId)
private

◆ getConceptUri()

Wikibase\Repo\Api\ConceptUriSearchHelper::getConceptUri ( EntityId $entityId)
private
Parameters
EntityId$entityId
Returns
string

◆ getRankedSearchResults()

Wikibase\Repo\Api\ConceptUriSearchHelper::getRankedSearchResults ( $text,
$languageCode,
$entityType,
$limit,
$strictLanguage,
?string $profileContext )

Get entities matching the search term.

Parameters
string$text
string$languageCode
string$entityType
int$limit
bool$strictLanguage
string | null$profileContextindication given to the engine on the context this search is made (might affect ranking)
Returns
TermSearchResult[] Key: string Serialized EntityId
Exceptions
EntitySearchExceptionwhen a problem occurs fetching data from the underlying datastore

Implements Wikibase\Repo\Api\EntitySearchHelper.

Member Data Documentation

◆ $entitySourceLookup

Wikibase\Repo\Api\ConceptUriSearchHelper::$entitySourceLookup
private

◆ $searchHelper

Wikibase\Repo\Api\ConceptUriSearchHelper::$searchHelper
private

◆ CONCEPTURI_META_DATA_KEY

const Wikibase\Repo\Api\ConceptUriSearchHelper::CONCEPTURI_META_DATA_KEY = TermSearchResult::CONCEPTURI_META_DATA_KEY

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