Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P10672
(An Untitled Masterwork)
Active
Public
Actions
Authored by
Addshore
on Mar 10 2020, 8:41 AM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Referenced Files
F31673889: raw.txt
Mar 10 2020, 8:41 AM
2020-03-10 08:41:11 (UTC+0)
Subscribers
Rosalie_WMDE
<?php
// TODO in namespace namespace Wikibase\Repo\FederatedProperties; ?
namespace
Wikibase\Repo\Api
;
use
Wikibase\Repo\FederatedProperties\GenericActionApiClient
;
class
ApiEntitySearchHelper
implements
EntitySearchHelper
{
/**
* @var GenericActionApiClient
* @todo inject me
*/
private
$api
;
/**
* @inheritDoc
*/
public
function
getRankedSearchResults
(
$text
,
$languageCode
,
$entityType
,
$limit
,
$strictLanguage
)
{
// https://www.wikidata.org/w/api.php?action=help&modules=wbsearchentities
$params
=
[
'search'
=>
$text
,
'language'
=>
$languageCode
,
'type'
=>
$entityType
,
'limit'
=>
$limit
,
'strictlanguage'
=>
$strictLanguage
,
];
$result
=
$this
->
api
->
get
(
$params
);
// TODO make an array of TermSearchResult objects from $result
}
}
Event Timeline
Addshore
created this paste.
Mar 10 2020, 8:41 AM
2020-03-10 08:41:11 (UTC+0)
Rosalie_WMDE
subscribed.
Mar 18 2020, 10:54 AM
2020-03-18 10:54:52 (UTC+0)
Log In to Comment