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

File features: filebits:16 - bit depth filesize:>300 - size >= 300 kb filew:100,300 - search of 100 <= file_width <= 300 Selects only files of these specified features. More...

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

Public Member Functions

 getCrossSearchStrategy (KeywordFeatureNode $node)
 
 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)
 
 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)
 

Protected Member Functions

 getKeywords ()
 
 doApply (SearchContext $context, $key, $value, $quotedValue, $negated)
 
 extractSign ( $value, $default=0)
 Extract sign prefix which can be < or > or nothing.
 
 nanWarning (WarningCollector $warningCollector, $key, $notANumber)
 Adds a warning to the search context that the $key keyword was provided with the invalid value $notANumber.
 
 doGetFilterQuery ( $key, $parsedValue)
 

Detailed Description

File features: filebits:16 - bit depth filesize:>300 - size >= 300 kb filew:100,300 - search of 100 <= file_width <= 300 Selects only files of these specified features.

Member Function Documentation

◆ doApply()

CirrusSearch\Query\FileNumericFeature::doApply ( SearchContext $context,
$key,
$value,
$quotedValue,
$negated )
protected
Parameters
SearchContext$context
string$keyThe keyword
string$valueThe value attached to the keyword with quotes stripped
string$quotedValueThe original value in the search string, including quotes if used
bool$negatedIs the search negated? Not used to generate the returned AbstractQuery, that will be negated as necessary. Used for any other building/context necessary.
Returns
array Two element array, first an AbstractQuery or null to apply to the query. Second a boolean indicating if the quotedValue should be kept in the search string.

Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.

◆ doGetFilterQuery()

CirrusSearch\Query\FileNumericFeature::doGetFilterQuery ( $key,
$parsedValue )
protected
Parameters
string$key
array$parsedValue
Returns
Query\AbstractQuery|null

◆ extractSign()

CirrusSearch\Query\FileNumericFeature::extractSign ( $value,
$default = 0 )
protected

Extract sign prefix which can be < or > or nothing.

Parameters
string$value
int$default
Returns
array Two element array, first the sign: 0 is equal, 1 is more, -1 is less, then the number to be compared.

◆ getCrossSearchStrategy()

CirrusSearch\Query\FileNumericFeature::getCrossSearchStrategy ( KeywordFeatureNode $node)
Parameters
KeywordFeatureNode$node
Returns
CrossSearchStrategy

Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.

◆ getFilterQuery()

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

Implements CirrusSearch\Query\FilterQueryFeature.

◆ getKeywords()

CirrusSearch\Query\FileNumericFeature::getKeywords ( )
protected
Returns
string[]

Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.

◆ nanWarning()

CirrusSearch\Query\FileNumericFeature::nanWarning ( WarningCollector $warningCollector,
$key,
$notANumber )
protected

Adds a warning to the search context that the $key keyword was provided with the invalid value $notANumber.

Parameters
WarningCollector$warningCollector
string$key
string$notANumber

◆ parseValue()

CirrusSearch\Query\FileNumericFeature::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.


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