CirrusSearch
Elasticsearch-powered search for MediaWiki
|
Base class supporting regex searches. More...
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. | |
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?/
CirrusSearch\Query\BaseRegexFeature::__construct | ( | SearchConfig | $config, |
array | $fields ) |
SearchConfig | $config | |
string[] | $fields |
CirrusSearch\Query\BaseRegexFeature::buildHighlightFields | ( | KeywordFeatureNode | $node, |
QueryBuildingContext | $context ) |
@inheritDoc
Implements CirrusSearch\Query\HighlightingFeature.
|
abstract |
Reimplemented in CirrusSearch\Query\InSourceFeature.
CirrusSearch\Query\BaseRegexFeature::doApplyExtended | ( | SearchContext | $context, |
$key, | |||
$value, | |||
$quotedValue, | |||
$negated, | |||
$delimiter, | |||
$suffix ) |
SearchContext | $context | |
string | $key | |
string | $value | |
string | $quotedValue | |
bool | $negated | |
string | $delimiter | |
string | $suffix |
Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.
CirrusSearch\Query\BaseRegexFeature::getCrossSearchStrategy | ( | KeywordFeatureNode | $node | ) |
KeywordFeatureNode | $node |
Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.
CirrusSearch\Query\BaseRegexFeature::getFeatureName | ( | $key, | |
$valueDelimiter ) |
string | $key | |
string | $valueDelimiter |
Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.
CirrusSearch\Query\BaseRegexFeature::getFilterQuery | ( | KeywordFeatureNode | $node, |
QueryBuildingContext | $context ) |
@inheritDoc
Implements CirrusSearch\Query\FilterQueryFeature.
|
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"
KeywordFeatureNode | $node | |
QueryBuildingContext | $context |
Reimplemented in CirrusSearch\Query\InSourceFeature, and CirrusSearch\Query\InTitleFeature.
CirrusSearch\Query\BaseRegexFeature::getValueDelimiters | ( | ) |
Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.
CirrusSearch\Query\BaseRegexFeature::parseValue | ( | $key, | |
$value, | |||
$quotedValue, | |||
$valueDelimiter, | |||
$suffix, | |||
WarningCollector | $warningCollector ) |
string | $key | |
string | $value | |
string | $quotedValue | |
string | $valueDelimiter | |
string | $suffix | |
WarningCollector | $warningCollector |
Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.