Wikibase
MediaWiki Wikibase extension
|
Helper class to search for entities by ID. More...
Public Member Functions | |
__construct (EntityLookup $entityLookup, EntityIdParser $idParser, LabelDescriptionLookup $labelDescriptionLookup, array $entityTypeToRepositoryMapping) | |
getRankedSearchResults ( $text, $languageCode, $entityType, $limit, $strictLanguage) | |
Gets exact matches. More... | |
Private Member Functions | |
getEntityIdMatchingSearchTerm ( $term, $entityType) | |
Returns EntityIds matching the search term (possibly with some repository prefix). More... | |
getEntityIdCandidatesForSearchTerm ( $term) | |
Returns a generator for candidates of entity ID serializations from a search term. More... | |
getMatchingId (EntityId $entityId) | |
Returns a list of entity IDs matching the pattern defined by $entityId: existing entities of type of $entityId, and serialized id equal to $entityId, possibly including prefixes of configured repositories. More... | |
getDisplayTerms (EntityId $entityId) | |
Private Attributes | |
$idParser | |
$labelDescriptionLookup | |
$entityLookup | |
$entityTypeToRepositoryMapping | |
Helper class to search for entities by ID.
Wikibase\Repo\Api\EntityIdSearchHelper::__construct | ( | EntityLookup | $entityLookup, |
EntityIdParser | $idParser, | ||
LabelDescriptionLookup | $labelDescriptionLookup, | ||
array | $entityTypeToRepositoryMapping | ||
) |
EntityLookup | $entityLookup | |
EntityIdParser | $idParser | |
LabelDescriptionLookup | $labelDescriptionLookup | |
string[][] | $entityTypeToRepositoryMapping | Associative array (string => string[][]) mapping entity types to a list of repository names which provide entities of the given type. |
|
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 EntityIds matching the search term (possibly with some repository prefix).
If search term is a serialized entity id of the requested type, and multiple repositories provide entities of the type, prefixes of each of repositories are added to the search term and those repositories are searched for the result entity ID. If such concatenated entity IDs are found in several respective repositories, this returns all relevant matches.
string | $term | |
string | $entityType |
|
private |
Returns a list of entity IDs matching the pattern defined by $entityId: existing entities of type of $entityId, and serialized id equal to $entityId, possibly including prefixes of configured repositories.
EntityId | $entityId |
Wikibase\Repo\Api\EntityIdSearchHelper::getRankedSearchResults | ( | $text, | |
$languageCode, | |||
$entityType, | |||
$limit, | |||
$strictLanguage | |||
) |
Gets exact matches.
If there are not enough exact matches, it gets prefixed matches.
string | $text | |
string | $languageCode | |
string | $entityType | |
int | $limit | |
bool | $strictLanguage |
Implements Wikibase\Repo\Api\EntitySearchHelper.
|
private |
|
private |
|
private |
|
private |