CirrusSearch
Elasticsearch-powered search for MediaWiki
|
Filters by one or more categories, specified either by name or by category id. More...
Public Member Functions | |
__construct (Config $config, PageStore $pageStore=null) | |
getCrossSearchStrategy (KeywordFeatureNode $node) | |
parseValue ( $key, $value, $quotedValue, $valueDelimiter, $suffix, WarningCollector $warningCollector) | |
expand (KeywordFeatureNode $node, SearchConfig $config, WarningCollector $warningCollector) | |
getFilterQuery (KeywordFeatureNode $node, QueryBuildingContext $context) | |
Public Member Functions inherited from CirrusSearch\Query\SimpleKeywordFeature | |
getKeywordPrefixes () | |
allowEmptyValue () | |
Whether this keyword allows empty value. | |
hasValue () | |
Whether this keyword can have a value. | |
greedy () | |
Whether this keyword is greedy consuming the rest of the string. | |
queryHeader () | |
Whether this keyword can appear only at the beginning of the query (excluding spaces) | |
getFeatureName ( $key, $valueDelimiter) | |
Determine the name of the feature being set in SearchContext::addSyntaxUsed Defaults to $key. | |
getValueDelimiters () | |
List of value delimiters supported (must be an array of single byte char) | |
doApplyExtended (SearchContext $context, $key, $value, $quotedValue, $negated, $delimiter, $suffix) | |
Fully featured apply method which delegates to doApply by default. | |
apply (SearchContext $context, $term) | |
Protected Member Functions | |
getKeywords () | |
doApply (SearchContext $context, $key, $value, $quotedValue, $negated) | |
Filters by one or more categories, specified either by name or by category id.
Multiple categories are separated by |. Categories specified by id must follow the syntax id:<id>
.
We emulate template syntax here as best as possible, so things in NS_MAIN are prefixed with ":" and things in NS_TEMPLATE don't have a prefix at all. Since we don't actually index templates like that, munge the query here.
Examples: incategory:id:12345 incategory:Music_by_genre incategory:Music_by_genre|Animals incategory:"Music by genre|Animals" incategory:Animals|id:54321 incategory::Something_in_NS_MAIN
CirrusSearch\Query\InCategoryFeature::__construct | ( | Config | $config, |
PageStore | $pageStore = null ) |
Config | $config | |
PageStore | null | $pageStore |
|
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. |
Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.
CirrusSearch\Query\InCategoryFeature::expand | ( | KeywordFeatureNode | $node, |
SearchConfig | $config, | ||
WarningCollector | $warningCollector ) |
KeywordFeatureNode | $node | |
SearchConfig | $config | |
WarningCollector | $warningCollector |
Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.
CirrusSearch\Query\InCategoryFeature::getCrossSearchStrategy | ( | KeywordFeatureNode | $node | ) |
KeywordFeatureNode | $node |
Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.
CirrusSearch\Query\InCategoryFeature::getFilterQuery | ( | KeywordFeatureNode | $node, |
QueryBuildingContext | $context ) |
KeywordFeatureNode | $node | |
QueryBuildingContext | $context |
Implements CirrusSearch\Query\FilterQueryFeature.
|
protected |
Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.
CirrusSearch\Query\InCategoryFeature::parseValue | ( | $key, | |
$value, | |||
$quotedValue, | |||
$valueDelimiter, | |||
$suffix, | |||
WarningCollector | $warningCollector ) |
string | $key | |
string | $value | |
string | $quotedValue | |
string | $valueDelimiter | |
string | $suffix | |
WarningCollector | $warningCollector |
Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.