|
Wikibase
MediaWiki Wikibase extension
|
API module to search for Wikibase entities. More...
Inheritance diagram for Wikibase\Repo\Api\SearchEntities:
Collaboration diagram for Wikibase\Repo\Api\SearchEntities:Public Member Functions | |
| __construct (ApiMain $mainModule, string $moduleName, LinkBatchFactory $linkBatchFactory, WbSearchEntitiesControllerDispatcher $searchControllerDispatcher, ContentLanguages $termLanguages, EntitySourceLookup $entitySourceLookup, EntityTitleLookup $entityTitleLookup, EntityTitleTextLookup $entityTitleTextLookup, EntityUrlLookup $entityUrlLookup, EntityArticleIdLookup $entityArticleIdLookup, ApiErrorReporter $errorReporter, array $enabledEntityTypes, array $searchProfiles) | |
| execute () | |
| executeInternal () | |
Static Public Member Functions | |
| static | factory (ApiMain $mainModule, string $moduleName, LinkBatchFactory $linkBatchFactory, WbSearchEntitiesControllerDispatcher $searchControllerDispatcher, ApiHelperFactory $apiHelperFactory, array $enabledEntityTypes, EntityArticleIdLookup $entityArticleIdLookup, EntitySourceLookup $entitySourceLookup, EntityTitleLookup $entityTitleLookup, EntityTitleTextLookup $entityTitleTextLookup, EntityUrlLookup $entityUrlLookup, SettingsArray $repoSettings, ContentLanguages $termsLanguages) |
Protected Member Functions | |
| getAllowedParams () | |
| getExamplesMessages () | |
Private Member Functions | |
| getSearchResults (array $params) | |
| Fetches the requested page of search results together with whether more results exist beyond it (used to emit the search-continue cursor). | |
| buildTermSearchMatchEntry (TermSearchResult $match, ?array $props) | |
| buildTermSearchMatchPageEntry (TermSearchResult $match, ?array $props) | |
| buildTermSearchMatchDisplayEntry (TermSearchResult $match, array $entry) | |
| getRepositoryOrEntitySourceName (EntityId $entityId) | |
| getDisplayTerm (Term $term) | |
| getApiUser () | |
Private Attributes | |
| const | CONTINUE_SOFT_LIMIT = self::LIMIT_SML1 |
| "Soft" limit on the "continue" parameter. | |
| const | CONTINUE_HARD_LIMIT = 10000 |
| "Hard" limit on the "continue" parameter. | |
| LinkBatchFactory | $linkBatchFactory |
| WbSearchEntitiesControllerDispatcher | $searchControllerDispatcher |
| ContentLanguages | $termsLanguages |
| EntitySourceLookup | $entitySourceLookup |
| EntityTitleLookup | $entityTitleLookup |
| EntityTitleTextLookup | $entityTitleTextLookup |
| EntityUrlLookup | $entityUrlLookup |
| EntityArticleIdLookup | $entityArticleIdLookup |
| ApiErrorReporter | $errorReporter |
| array | $enabledEntityTypes |
| array | $searchProfiles |
API module to search for Wikibase entities.
| Wikibase\Repo\Api\SearchEntities::__construct | ( | ApiMain | $mainModule, |
| string | $moduleName, | ||
| LinkBatchFactory | $linkBatchFactory, | ||
| WbSearchEntitiesControllerDispatcher | $searchControllerDispatcher, | ||
| ContentLanguages | $termLanguages, | ||
| EntitySourceLookup | $entitySourceLookup, | ||
| EntityTitleLookup | $entityTitleLookup, | ||
| EntityTitleTextLookup | $entityTitleTextLookup, | ||
| EntityUrlLookup | $entityUrlLookup, | ||
| EntityArticleIdLookup | $entityArticleIdLookup, | ||
| ApiErrorReporter | $errorReporter, | ||
| array | $enabledEntityTypes, | ||
| array | $searchProfiles ) |
|
private |
Add matched terms to the aliases key in the result to give some context for the matched Term if the matched term is different to the alias. XXX: This appears odd but is used in the UI / Entity suggesters
|
private |
| TermSearchResult | $match | |
| string[] | null | $props |
|
private |
| TermSearchResult | $match | |
| string[] | null | $props |
The repository key should be deprecated and removed, for now avoid adding it when using federatedProperties to avoid confusion in the new feature and avoid the need to "fix" it.. This is deliberately not tested and thus not injected as for federated properties we "don't care much" and for default Wikibase this is already covered by the SearchEntitiesTest.
| Wikibase\Repo\Api\SearchEntities::execute | ( | ) |
| Wikibase\Repo\Api\SearchEntities::executeInternal | ( | ) |
| ApiUsageException | |
| EntitySearchException |
|
static |
|
protected |
|
private |
|
private |
|
protected |
|
private |
|
private |
Fetches the requested page of search results together with whether more results exist beyond it (used to emit the search-continue cursor).
| array | $params |
| ApiUsageException |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
"Hard" limit on the "continue" parameter.
Past this point, continuation is not allowed (T355251). The value is mostly arbitrary (could be somewhat higher or lower), but chosen to coincide with CirrusSearch's Searcher::MAX_OFFSET_LIMIT: when using CirrusSearch, it's not possible to get more than 10000 search results anyway.
|
private |
"Soft" limit on the "continue" parameter.
Past this point, we won't add it to the response, though users can still ask for higher continuation offsets manually.