CirrusSearch
Elasticsearch-powered search for MediaWiki
Loading...
Searching...
No Matches
CirrusSearch\Query\HasRecommendationFeature Class Reference

Filters the result set based on the existing article recommendation. More...

+ Inheritance diagram for CirrusSearch\Query\HasRecommendationFeature:
+ Collaboration diagram for CirrusSearch\Query\HasRecommendationFeature:

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)
 @inheritDoc
 
 getKeywords ()
 @inheritDoc
 

Detailed Description

Filters the result set based on the existing article recommendation.

Currently we handle link and image recommendations.

Examples: hasrecommendation:image hasrecommendation:link|image

Member Function Documentation

◆ doApply()

CirrusSearch\Query\HasRecommendationFeature::doApply ( SearchContext $context,
$key,
$value,
$quotedValue,
$negated )
protected

@inheritDoc

Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.

◆ getFilterQuery()

CirrusSearch\Query\HasRecommendationFeature::getFilterQuery ( KeywordFeatureNode $node,
QueryBuildingContext $context )
Parameters
KeywordFeatureNode$node
QueryBuildingContext$context
Returns
AbstractQuery|null

Implements CirrusSearch\Query\FilterQueryFeature.

◆ getKeywords()

CirrusSearch\Query\HasRecommendationFeature::getKeywords ( )
protected

@inheritDoc

Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.

◆ parseValue()

CirrusSearch\Query\HasRecommendationFeature::parseValue ( $key,
$value,
$quotedValue,
$valueDelimiter,
$suffix,
WarningCollector $warningCollector )
Parameters
string$key
string$value
string$quotedValue
string$valueDelimiter
string$suffix
WarningCollector$warningCollector
Returns
array|false|null

Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.

Member Data Documentation

◆ QUERY_LIMIT

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.


The documentation for this class was generated from the following file: