Wikibase
MediaWiki Wikibase extension
|
Handles the search keyword 'haswbstatement:'. More...
Public Member Functions | |
__construct (array $foreignRepoNames) | |
HasWbStatementFeature constructor. More... | |
parseValue ( $key, $value, $quotedValue, $valueDelimiter, $suffix, WarningCollector $warningCollector) | |
getFilterQuery (KeywordFeatureNode $node, QueryBuildingContext $context) | |
Protected Member Functions | |
getKeywords () | |
doApply (SearchContext $context, $key, $value, $quotedValue, $negated) | |
Handles the search keyword 'haswbstatement:'.
Allows the user to search for pages/items that have wikibase statements associated with them.
If a file page has the statement 'wikidata:P180=wikidata:Q527' (meaning 'depicts sky') associated with it then it can be found by including 'haswbstatement:wikidata:P180=wikidata:Q527' in the search query.
If a file page has the statement 'wikidata:P2014=79802' (meaning 'MoMA artwork id 79802') associated with it then it can be found by including 'haswbstatement:wikidata:P2014=79802' in the search query.
Statements can be combined using logical OR by separating them with a | character in a single haswbstatement query e.g. 'haswbstatement:P999=Q888|P999=Q777'
Statements can be combined using logical AND by using two separate haswbstatement queries e.g. 'haswbstatement:P999=Q888 haswbstatement:P999=Q777'
Note that NOT ALL STATEMENTS ARE INDEXED. Searching for a statement about a property that has not been indexed will give an empty result set.
@uses CirrusSearch
Wikibase\Repo\Search\Elastic\Query\HasWbStatementFeature::__construct | ( | array | $foreignRepoNames | ) |
HasWbStatementFeature constructor.
array | $foreignRepoNames | Array of names of foreign repos from $wgWBRepoSettings |
|
protected |
SearchContext | $context | |
string | $key | The keyword |
string | $value | The value attached to the keyword with quotes stripped |
string | $quotedValue | The original value in the search string, including quotes if used |
bool | $negated | Is the search negated? Not used to generate the returned AbstractQuery, that will be negated as necessary. Used for any other building/context necessary. |
Wikibase\Repo\Search\Elastic\Query\HasWbStatementFeature::getFilterQuery | ( | KeywordFeatureNode | $node, |
QueryBuildingContext | $context | ||
) |
KeywordFeatureNode | $node | |
QueryBuildingContext | $context |
|
protected |
Wikibase\Repo\Search\Elastic\Query\HasWbStatementFeature::parseValue | ( | $key, | |
$value, | |||
$quotedValue, | |||
$valueDelimiter, | |||
$suffix, | |||
WarningCollector | $warningCollector | ||
) |
string | $key | |
string | $value | |
string | $quotedValue | |
string | $valueDelimiter | |
string | $suffix | |
WarningCollector | $warningCollector |