CirrusSearch
Elasticsearch-powered search for MediaWiki
|
Filters the result set based on the existing article recommendation. More...
Public Member Functions | |
parseValue ( $key, $value, $quotedValue, $valueDelimiter, $suffix, 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) | |
getCrossSearchStrategy (KeywordFeatureNode $node) | |
expand (KeywordFeatureNode $node, SearchConfig $config, WarningCollector $warningCollector) | |
doApplyExtended (SearchContext $context, $key, $value, $quotedValue, $negated, $delimiter, $suffix) | |
Fully featured apply method which delegates to doApply by default. | |
apply (SearchContext $context, $term) | |
Public Attributes | |
const | QUERY_LIMIT = 5 |
Limit filtering to 5 recommendation types. | |
Protected Member Functions | |
doApply (SearchContext $context, $key, $value, $quotedValue, $negated) | |
Applies the detected keyword from the search term. | |
getKeywords () | |
NOTE: will be removed once all implementations implement getKeywordStrings (transitional state to change the visibility of getKeywords()) | |
Filters the result set based on the existing article recommendation.
Currently we handle link and image recommendations.
Examples: hasrecommendation:image hasrecommendation:link|image
|
protected |
Applies the detected keyword from the search term.
May apply changes either to $context directly, or return a filter to be added.
SearchContext | $context | |
string | $key | The keyword |
string | $value | The value attached to the keyword with quotes stripped and escaped quotes un-escaped. |
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\HasRecommendationFeature::getFilterQuery | ( | KeywordFeatureNode | $node, |
QueryBuildingContext | $context ) |
KeywordFeatureNode | $node | |
QueryBuildingContext | $context |
Implements CirrusSearch\Query\FilterQueryFeature.
|
protected |
NOTE: will be removed once all implementations implement getKeywordStrings (transitional state to change the visibility of getKeywords())
Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.
CirrusSearch\Query\HasRecommendationFeature::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.
const CirrusSearch\Query\HasRecommendationFeature::QUERY_LIMIT = 5 |
Limit filtering to 5 recommendation types.
Arbitrarily chosen, but should be more than enough and some sort of limit has to be enforced.