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

Feature for filtering on specific text fields. More...

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

Public Member Functions

 __construct ( $keyword, $field)
 
 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)
 
 parseValue ( $key, $value, $quotedValue, $valueDelimiter, $suffix, WarningCollector $warningCollector)
 Parse the value of the keyword.
 
 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)
 
 doGetFilterQuery ( $value, $quotedValue)
 

Detailed Description

Feature for filtering on specific text fields.

Supports plain AND matching by default, and phrase matching when quoted.

Constructor & Destructor Documentation

◆ __construct()

CirrusSearch\Query\TextFieldFilterFeature::__construct ( $keyword,
$field )
Parameters
string$keywordFull text keyword to register
string$fieldElasticsearch field to filter against

Member Function Documentation

◆ doApply()

CirrusSearch\Query\TextFieldFilterFeature::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\TextFieldFilterFeature::doGetFilterQuery ( $value,
$quotedValue )
protected
Parameters
string$value
string$quotedValue
Returns
Query\MatchQuery|Query\MatchPhrase

◆ getCrossSearchStrategy()

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

Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.

◆ getFilterQuery()

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

Implements CirrusSearch\Query\FilterQueryFeature.

◆ getKeywords()

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

Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.


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