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

Base class supporting regex searches. More...

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

Public Member Functions

 __construct (SearchConfig $config, array $fields)
 
 getValueDelimiters ()
 
 parseValue ( $key, $value, $quotedValue, $valueDelimiter, $suffix, WarningCollector $warningCollector)
 
 getFeatureName ( $key, $valueDelimiter)
 
 getCrossSearchStrategy (KeywordFeatureNode $node)
 
 doApplyExtended (SearchContext $context, $key, $value, $quotedValue, $negated, $delimiter, $suffix)
 
 getFilterQuery (KeywordFeatureNode $node, QueryBuildingContext $context)
 @inheritDoc
 
 buildHighlightFields (KeywordFeatureNode $node, QueryBuildingContext $context)
 @inheritDoc
 
 buildNonRegexHLFields (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)
 
 expand (KeywordFeatureNode $node, SearchConfig $config, WarningCollector $warningCollector)
 
 apply (SearchContext $context, $term)
 

Protected Member Functions

 getNonRegexFilterQuery (KeywordFeatureNode $node, QueryBuildingContext $context)
 Obtain the filter when the keyword is used in non regex mode.
 
- Protected Member Functions inherited from CirrusSearch\Query\SimpleKeywordFeature
 getKeywords ()
 NOTE: will be removed once all implementations implement getKeywordStrings (transitional state to change the visibility of getKeywords())
 
 doApply (SearchContext $context, $key, $value, $quotedValue, $negated)
 Applies the detected keyword from the search term.
 

Detailed Description

Base class supporting regex searches.

Works best when combined with the wikimedia-extra plugin for elasticsearch, but can also fallback to a groovy based implementation. Can be really expensive, but mostly ok if you have the extra plugin enabled.

Examples: insource:/abc?/

See also
SourceRegex

Constructor & Destructor Documentation

◆ __construct()

CirrusSearch\Query\BaseRegexFeature::__construct ( SearchConfig $config,
array $fields )
Parameters
SearchConfig$config
string[]$fields

Member Function Documentation

◆ buildHighlightFields()

CirrusSearch\Query\BaseRegexFeature::buildHighlightFields ( KeywordFeatureNode $node,
QueryBuildingContext $context )

@inheritDoc

Implements CirrusSearch\Query\HighlightingFeature.

◆ buildNonRegexHLFields()

CirrusSearch\Query\BaseRegexFeature::buildNonRegexHLFields ( KeywordFeatureNode $node,
QueryBuildingContext $context )
abstract

◆ doApplyExtended()

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

◆ getCrossSearchStrategy()

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

Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.

◆ getFeatureName()

CirrusSearch\Query\BaseRegexFeature::getFeatureName ( $key,
$valueDelimiter )
Parameters
string$key
string$valueDelimiter
Returns
string

Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.

◆ getFilterQuery()

CirrusSearch\Query\BaseRegexFeature::getFilterQuery ( KeywordFeatureNode $node,
QueryBuildingContext $context )

@inheritDoc

Implements CirrusSearch\Query\FilterQueryFeature.

◆ getNonRegexFilterQuery()

CirrusSearch\Query\BaseRegexFeature::getNonRegexFilterQuery ( KeywordFeatureNode $node,
QueryBuildingContext $context )
abstractprotected

Obtain the filter when the keyword is used in non regex mode.

This method will be called on syntax like keyword:word or keyword:"phrase"

Parameters
KeywordFeatureNode$node
QueryBuildingContext$context
Returns
AbstractQuery|null

Reimplemented in CirrusSearch\Query\InSourceFeature, and CirrusSearch\Query\InTitleFeature.

◆ getValueDelimiters()

CirrusSearch\Query\BaseRegexFeature::getValueDelimiters ( )
Returns
string[][]

Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.

◆ parseValue()

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