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

Applies a filter against the title field in elasticsearch. More...

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

Public Member Functions

 __construct (SearchConfig $config)
 
 buildNonRegexHLFields (KeywordFeatureNode $node, QueryBuildingContext $context)
 
- Public Member Functions inherited from CirrusSearch\Query\BaseRegexFeature
 __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
 
- 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

 getKeywords ()
 
 doApply (SearchContext $context, $key, $value, $quotedValue, $negated)
 
 getNonRegexFilterQuery (KeywordFeatureNode $node, QueryBuildingContext $context)
 

Detailed Description

Applies a filter against the title field in elasticsearch.

When not negated the term remains in the original query as a scoring signal. The term itself is used as a QueryString query, so some advanced syntax like * and phrase matches can be used. Note that quotes in the incoming query are maintained in the generated filter.

Examples: intitle:Foo intitle:Foo* intitle:"gold rush"

Things that might seem like they would work, but don't. This is because the quotes are maintained in the filter and in the top level query. intitle:"foo*" intitle:"foo OR bar"

Member Function Documentation

◆ buildNonRegexHLFields()

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

◆ doApply()

CirrusSearch\Query\InTitleFeature::doApply ( SearchContext $context,
$key,
$value,
$quotedValue,
$negated )
protected
Parameters
SearchContext$context
string$keyThe keyword
string$valueThe value attached to the keyword with quotes stripped
string$quotedValueThe original value in the search string, including quotes if used
bool$negatedIs the search negated? Not used to generate the returned AbstractQuery, that will be negated as necessary. Used for any other building/context necessary.
Returns
array Two element array, first an AbstractQuery or null to apply to the query. Second a boolean indicating if the quotedValue should be kept in the search string.

Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.

◆ getKeywords()

CirrusSearch\Query\InTitleFeature::getKeywords ( )
protected
Returns
string[]

Reimplemented from CirrusSearch\Query\SimpleKeywordFeature.

◆ getNonRegexFilterQuery()

CirrusSearch\Query\InTitleFeature::getNonRegexFilterQuery ( KeywordFeatureNode $node,
QueryBuildingContext $context )
protected
Parameters
KeywordFeatureNode$node
QueryBuildingContext$context
Returns
AbstractQuery|null

Reimplemented from CirrusSearch\Query\BaseRegexFeature.


The documentation for this class was generated from the following file: