API module to search for Wikibase entities.
More...
|
| __construct (ApiMain $mainModule, string $moduleName, LinkBatchFactory $linkBatchFactory, EntitySearchHelper $entitySearchHelper, ContentLanguages $termLanguages, EntitySourceLookup $entitySourceLookup, EntityTitleLookup $entityTitleLookup, EntityTitleTextLookup $entityTitleTextLookup, EntityUrlLookup $entityUrlLookup, EntityArticleIdLookup $entityArticleIdLookup, ApiErrorReporter $errorReporter, array $enabledEntityTypes, array $searchProfiles) |
|
| execute () |
|
| executeInternal () |
|
|
static | factory (ApiMain $mainModule, string $moduleName, LinkBatchFactory $linkBatchFactory, ApiHelperFactory $apiHelperFactory, array $enabledEntityTypes, EntityArticleIdLookup $entityArticleIdLookup, EntitySearchHelper $entitySearchHelper, EntitySourceLookup $entitySourceLookup, EntityTitleLookup $entityTitleLookup, EntityTitleTextLookup $entityTitleTextLookup, EntityUrlLookup $entityUrlLookup, SettingsArray $repoSettings, ContentLanguages $termsLanguages) |
|
API module to search for Wikibase entities.
- Copyright
- GPL-2.0-or-later
◆ __construct()
Wikibase\Repo\Api\SearchEntities::__construct |
( |
ApiMain | $mainModule, |
|
|
string | $moduleName, |
|
|
LinkBatchFactory | $linkBatchFactory, |
|
|
EntitySearchHelper | $entitySearchHelper, |
|
|
ContentLanguages | $termLanguages, |
|
|
EntitySourceLookup | $entitySourceLookup, |
|
|
EntityTitleLookup | $entityTitleLookup, |
|
|
EntityTitleTextLookup | $entityTitleTextLookup, |
|
|
EntityUrlLookup | $entityUrlLookup, |
|
|
EntityArticleIdLookup | $entityArticleIdLookup, |
|
|
ApiErrorReporter | $errorReporter, |
|
|
array | $enabledEntityTypes, |
|
|
array | $searchProfiles ) |
- See also
- ApiBase::__construct
◆ buildTermSearchMatchEntry()
Wikibase\Repo\Api\SearchEntities::buildTermSearchMatchEntry |
( |
TermSearchResult | $match, |
|
|
?array | $props ) |
|
private |
- Parameters
-
TermSearchResult | $match | |
string[] | null | $props | |
- Returns
- array
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.
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
◆ execute()
Wikibase\Repo\Api\SearchEntities::execute |
( |
| ) |
|
◆ executeInternal()
Wikibase\Repo\Api\SearchEntities::executeInternal |
( |
| ) |
|
- Exceptions
-
ApiUsageException
- Exceptions
-
◆ factory()
static Wikibase\Repo\Api\SearchEntities::factory |
( |
ApiMain | $mainModule, |
|
|
string | $moduleName, |
|
|
LinkBatchFactory | $linkBatchFactory, |
|
|
ApiHelperFactory | $apiHelperFactory, |
|
|
array | $enabledEntityTypes, |
|
|
EntityArticleIdLookup | $entityArticleIdLookup, |
|
|
EntitySearchHelper | $entitySearchHelper, |
|
|
EntitySourceLookup | $entitySourceLookup, |
|
|
EntityTitleLookup | $entityTitleLookup, |
|
|
EntityTitleTextLookup | $entityTitleTextLookup, |
|
|
EntityUrlLookup | $entityUrlLookup, |
|
|
SettingsArray | $repoSettings, |
|
|
ContentLanguages | $termsLanguages ) |
|
static |
◆ getAllowedParams()
Wikibase\Repo\Api\SearchEntities::getAllowedParams |
( |
| ) |
|
|
protected |
◆ getDisplayTerm()
Wikibase\Repo\Api\SearchEntities::getDisplayTerm |
( |
Term | $term | ) |
|
|
private |
◆ getExamplesMessages()
Wikibase\Repo\Api\SearchEntities::getExamplesMessages |
( |
| ) |
|
|
protected |
◆ getRepositoryOrEntitySourceName()
Wikibase\Repo\Api\SearchEntities::getRepositoryOrEntitySourceName |
( |
EntityId | $entityId | ) |
|
|
private |
◆ getSearchResults()
Wikibase\Repo\Api\SearchEntities::getSearchResults |
( |
array | $params | ) |
|
|
private |
Populates the search result returning the number of requested matches plus one additional item for being able to determine if there would be any more results.
If there are not enough exact matches, the list of returned entries will be additionally filled with prefixed matches.
- Parameters
-
- Returns
- TermSearchResult[]
- Exceptions
-
ApiUsageException
◆ $enabledEntityTypes
array Wikibase\Repo\Api\SearchEntities::$enabledEntityTypes |
|
private |
◆ $entityArticleIdLookup
◆ $entitySearchHelper
◆ $entitySourceLookup
◆ $entityTitleLookup
◆ $entityTitleTextLookup
◆ $entityUrlLookup
◆ $errorReporter
◆ $linkBatchFactory
LinkBatchFactory Wikibase\Repo\Api\SearchEntities::$linkBatchFactory |
|
private |
◆ $searchProfiles
array Wikibase\Repo\Api\SearchEntities::$searchProfiles |
|
private |
◆ $termsLanguages
◆ CONTINUE_HARD_LIMIT
const Wikibase\Repo\Api\SearchEntities::CONTINUE_HARD_LIMIT = 10000 |
|
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.
◆ CONTINUE_SOFT_LIMIT
const Wikibase\Repo\Api\SearchEntities::CONTINUE_SOFT_LIMIT = self::LIMIT_SML1 |
|
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.
The documentation for this class was generated from the following file: