CirrusSearch
Elasticsearch-powered search for MediaWiki
|
Handles the boost-templates keyword in full text search. More...
Public Member Functions | |
getCrossSearchStrategy (KeywordFeatureNode $node) | |
parseValue ( $key, $value, $quotedValue, $valueDelimiter, $suffix, WarningCollector $warningCollector) | |
getBoostFunctionBuilder (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) | |
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 | parseBoostTemplates ( $text) |
Parse boosted templates. | |
Protected Member Functions | |
getKeywords () | |
doApply (SearchContext $context, $key, $value, $quotedValue, $negated) | |
Handles the boost-templates keyword in full text search.
Allows user to specify a percentage to increase or decrease a search result by based on the templates included in the page. Templates can be specified with spaces or underscores. Multiple templates can be specified. Any value including a space must be quoted.
Examples: boost-templates:Main_article|250% boost-templates:"Featured sound|150%" boost-templates:"Main_article|250% List_of_lists|10%"
|
protected |
SearchContext | $context | |
string | $key | The keyword |
string | $value | The value attached to the keyword with quotes stripped |
string | $quotedValue | The original value in the search string, including quotes if used |
bool | $negated | Is the search negated? Not used to generate the returned AbstractQuery, that will be negated as necessary. Used for any other building/context necessary. |
Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.
CirrusSearch\Query\BoostTemplatesFeature::getBoostFunctionBuilder | ( | KeywordFeatureNode | $node, |
QueryBuildingContext | $context ) |
KeywordFeatureNode | $node | |
QueryBuildingContext | $context |
Implements CirrusSearch\Query\BoostFunctionFeature.
CirrusSearch\Query\BoostTemplatesFeature::getCrossSearchStrategy | ( | KeywordFeatureNode | $node | ) |
KeywordFeatureNode | $node |
Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.
|
protected |
Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.
|
static |
Parse boosted templates.
Parse failures silently return no boosted templates. Matches a template name followed by a | then a positive integer followed by a %. Multiple templates can be specified separated by a space.
Examples: Featured_article|150% List of lists|10% Featured_sound|200%
string | $text | text representation of boosted templates |
CirrusSearch\Query\BoostTemplatesFeature::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.