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

We emulate template syntax here as best as possible, so things in NS_MAIN are prefixed with ":" and things in NS_TEMPATE don't have a prefix at all. More...

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

Public Member Functions

 doApplyExtended (SearchContext $context, $key, $value, $quotedValue, $negated, $delimiter, $suffix)
 
 parseValue ( $key, $value, $quotedValue, $valueDelimiter, $suffix, WarningCollector $warningCollector)
 
 getCrossSearchStrategy (KeywordFeatureNode $node)
 
 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)
 
 apply (SearchContext $context, $term)
 

Public Attributes

const MAX_CONDITIONS = 256
 

Protected Member Functions

 getKeywords ()
 
 doGetFilterQuery (array $parsedValue)
 
 doApply (SearchContext $context, $key, $value, $quotedValue, $negated)
 Applies the detected keyword from the search term.
 

Detailed Description

We emulate template syntax here as best as possible, so things in NS_MAIN are prefixed with ":" and things in NS_TEMPATE don't have a prefix at all.

Since we don't actually index templates like that, munge the query here.

Member Function Documentation

◆ doApply()

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

Applies the detected keyword from the search term.

May apply changes either to $context directly, or return a filter to be added.

Parameters
SearchContext$context
string$keyThe keyword
string$valueThe value attached to the keyword with quotes stripped and escaped quotes un-escaped.
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.

◆ doApplyExtended()

CirrusSearch\Query\HasTemplateFeature::doApplyExtended ( SearchContext $context,
$key,
$value,
$quotedValue,
$negated,
$delimiter,
$suffix )
Parameters
SearchContext$context
string$key
string$value
string$quotedValue
bool$negated
string$delimiter
string$suffix
Returns
array

Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.

◆ doGetFilterQuery()

CirrusSearch\Query\HasTemplateFeature::doGetFilterQuery ( array $parsedValue)
protected
Parameters
string[][]$parsedValue
Returns
AbstractQuery

◆ getCrossSearchStrategy()

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

Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.

◆ getFilterQuery()

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

Implements CirrusSearch\Query\FilterQueryFeature.

◆ getKeywords()

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

Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.

◆ parseValue()

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