CirrusSearch
Elasticsearch-powered search for MediaWiki
|
Handles the prefix: keyword for matching titles. More...
Public Member Functions | |
__construct (?NamespacePrefixParser $namespacePrefixParser=null) | |
greedy () | |
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. | |
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) | |
Static Public Member Functions | |
static | prepareSearchContext (SearchContext $context, $prefix, ?NamespacePrefixParser $namespacePrefixParser=null) |
Adds a prefix filter to the search context. | |
Public Attributes | |
const | PARSED_NAMESPACES = 'parsed_namespaces' |
key value to set in the array returned by KeywordFeature::parsedValue() to instruct the parser that additional namespaces are needed for the query to function properly. | |
Protected Member Functions | |
getKeywords () | |
doApply (SearchContext $context, $key, $value, $quotedValue, $negated) | |
Handles the prefix: keyword for matching titles.
Can be used to specify a namespace, a prefix of the title, or both. Note that unlike other keyword features this greedily uses everything after the prefix: keyword, so must be used at the end of the query. Also note that this will override namespace filters previously applied to the SearchContext.
Examples: prefix:Calif prefix:Talk: prefix:Talk:Calif prefix:California Cou prefix:"California Cou"
|
protected |
SearchContext | $context | |
string | $key | |
string | $value | |
string | $quotedValue | |
bool | $negated |
Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.
CirrusSearch\Query\PrefixFeature::getCrossSearchStrategy | ( | KeywordFeatureNode | $node | ) |
KeywordFeatureNode | $node |
Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.
CirrusSearch\Query\PrefixFeature::getFilterQuery | ( | KeywordFeatureNode | $node, |
QueryBuildingContext | $context ) |
KeywordFeatureNode | $node | |
QueryBuildingContext | $context |
Implements CirrusSearch\Query\FilterQueryFeature.
|
protected |
Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.
CirrusSearch\Query\PrefixFeature::greedy | ( | ) |
Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.
CirrusSearch\Query\PrefixFeature::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.
|
static |
Adds a prefix filter to the search context.
SearchContext | $context | |
string | $prefix | |
NamespacePrefixParser | null | $namespacePrefixParser |
const CirrusSearch\Query\PrefixFeature::PARSED_NAMESPACES = 'parsed_namespaces' |
key value to set in the array returned by KeywordFeature::parsedValue() to instruct the parser that additional namespaces are needed for the query to function properly.
NOTE: a value of 'all' means that all namespaces are required are required.