Wikibase
MediaWiki Wikibase extension
|
Helper class to search for entities by ID. More...
Public Member Functions | |
__construct (EntityLookup $entityLookup, EntityIdParser $idParser, LabelDescriptionLookup $labelDescriptionLookup, array $entityTypes) | |
getRankedSearchResults ( $text, $languageCode, $entityType, $limit, $strictLanguage, ?string $profileContext) | |
Gets exact matches. | |
Private Member Functions | |
getEntityIdMatchingSearchTerm ( $term, $entityType) | |
Returns EntityId matching the search term. | |
getEntityIdCandidatesForSearchTerm ( $term) | |
Returns a generator for candidates of entity ID serializations from a search term. | |
getMatchingId (EntityId $entityId) | |
Returns an entity ID matching the pattern defined by $entityId: existing entity of type of $entityId, and serialized id equal to $entityId. | |
getDisplayTerms (EntityId $entityId) | |
Private Attributes | |
$idParser | |
$labelDescriptionLookup | |
$entityLookup | |
$entityTypes | |
Helper class to search for entities by ID.
Wikibase\Repo\Api\EntityIdSearchHelper::__construct | ( | EntityLookup | $entityLookup, |
EntityIdParser | $idParser, | ||
LabelDescriptionLookup | $labelDescriptionLookup, | ||
array | $entityTypes ) |
EntityLookup | $entityLookup | |
EntityIdParser | $idParser | |
LabelDescriptionLookup | $labelDescriptionLookup | |
string[] | $entityTypes | list of "names" of known entity types |
|
private |
EntityId | $entityId |
|
private |
Returns a generator for candidates of entity ID serializations from a search term.
Callers should attempt to parse each candidate in turn and use the first one that does not result in an EntityIdParsingException
.
string | $term |
|
private |
Returns EntityId matching the search term.
string | $term | |
string | $entityType |
|
private |
Returns an entity ID matching the pattern defined by $entityId: existing entity of type of $entityId, and serialized id equal to $entityId.
EntityId | $entityId |
Wikibase\Repo\Api\EntityIdSearchHelper::getRankedSearchResults | ( | $text, | |
$languageCode, | |||
$entityType, | |||
$limit, | |||
$strictLanguage, | |||
?string | $profileContext ) |
Gets exact matches.
If there are not enough exact matches, it gets prefixed matches.
string | $text | |
string | $languageCode | |
string | $entityType | |
int | $limit | |
bool | $strictLanguage | |
string | null | $profileContext |
Implements Wikibase\Repo\Api\EntitySearchHelper.
|
private |
|
private |
|
private |
|
private |