CirrusSearch
Elasticsearch-powered search for MediaWiki
|
Filters by category or its subcategories. More...
Public Member Functions | |
__construct (Config $config, SparqlClient $client=null) | |
getCrossSearchStrategy (KeywordFeatureNode $node) | |
getFeatureName ( $key, $valueDelimiter) | |
expand (KeywordFeatureNode $node, SearchConfig $config, 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. | |
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) | |
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. | |
doApplyExtended (SearchContext $context, $key, $value, $quotedValue, $negated, $delimiter, $suffix) | |
Fully featured apply method which delegates to doApply by default. | |
apply (SearchContext $context, $term) | |
Public Attributes | |
const | USER_AGENT = 'CirrusSearch deepcat feature' |
User agent to use for SPARQL queries. | |
const | TIMEOUT = 3 |
Timeout (in seconds) for SPARQL query. | |
Protected Member Functions | |
getKeywords () | |
doApply (SearchContext $context, $key, $value, $quotedValue, $negated) | |
Applies the detected keyword from the search term. | |
doGetFilterQuery (array $categories) | |
Filters by category or its subcategories.
E.g. if category Vehicles includes Cars and Boats, then search for Vehicles would match pages in Vehicles, Cars and Boats.
Syntax: deepcat:Vehicles
CirrusSearch\Query\DeepcatFeature::__construct | ( | Config | $config, |
SparqlClient | $client = null ) |
Config | $config | |
SparqlClient | null | $client |
|
protected |
Applies the detected keyword from the search term.
May apply changes either to $context directly, or return a filter to be added.
SearchContext | $context | |
string | $key | The keyword |
string | $value | The value attached to the keyword with quotes stripped and escaped quotes un-escaped. |
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.
|
protected |
array | $categories |
CirrusSearch\Query\DeepcatFeature::expand | ( | KeywordFeatureNode | $node, |
SearchConfig | $config, | ||
WarningCollector | $warningCollector ) |
KeywordFeatureNode | $node | |
SearchConfig | $config | |
WarningCollector | $warningCollector |
Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.
CirrusSearch\Query\DeepcatFeature::getCrossSearchStrategy | ( | KeywordFeatureNode | $node | ) |
KeywordFeatureNode | $node |
Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.
CirrusSearch\Query\DeepcatFeature::getFeatureName | ( | $key, | |
$valueDelimiter ) |
string | $key | |
string | $valueDelimiter |
Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.
CirrusSearch\Query\DeepcatFeature::getFilterQuery | ( | KeywordFeatureNode | $node, |
QueryBuildingContext | $context ) |
KeywordFeatureNode | $node | |
QueryBuildingContext | $context |
Implements CirrusSearch\Query\FilterQueryFeature.
|
protected |
Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.
const CirrusSearch\Query\DeepcatFeature::TIMEOUT = 3 |
Timeout (in seconds) for SPARQL query.
TODO: make configurable?