CirrusSearch
Elasticsearch-powered search for MediaWiki
Loading...
Searching...
No Matches
CirrusSearch\Query\FilterQueryFeature Interface Reference

A KeywordFeature that generates an elasticsearch query used as a filter. More...

+ Inheritance diagram for CirrusSearch\Query\FilterQueryFeature:

Public Member Functions

 getFilterQuery (KeywordFeatureNode $node, QueryBuildingContext $context)
 Build a filter query using the information available in KeywordFeatureNode or in QueryBuildingContext::getKeywordExpandedData() This method will be called at the very end of the query generation process when building the query of the search request.
 

Detailed Description

A KeywordFeature that generates an elasticsearch query used as a filter.

When a keyword implementation wants to filter a subset of docs matching a particular field/term it needs to implement this interface. This interface should only be implemented by KeywordFeature implementations.

See also
AbstractQuery
KeywordFeature

Member Function Documentation

◆ getFilterQuery()

CirrusSearch\Query\FilterQueryFeature::getFilterQuery ( KeywordFeatureNode $node,
QueryBuildingContext $context )

Build a filter query using the information available in KeywordFeatureNode or in QueryBuildingContext::getKeywordExpandedData() This method will be called at the very end of the query generation process when building the query of the search request.

The implementor may return null in case the parsed data is inappropriate it may help the query generation code to optimize the search process by not sending a search request to the backend (e.g. when this keyword is part of a conjunction at the root)

Parameters
KeywordFeatureNode$nodethe node corresponding to this keyword that was parsed
QueryBuildingContext$context
Returns
AbstractQuery|null the filter to apply or null if the information parsed in $node does not allow the query to be built.
See also
QueryBuildingContext::getKeywordExpandedData()

Implemented in CirrusSearch\Query\BaseRegexFeature, CirrusSearch\Query\ContentModelFeature, CirrusSearch\Query\DeepcatFeature, CirrusSearch\Query\FileTypeFeature, CirrusSearch\Query\HasRecommendationFeature, CirrusSearch\Query\HasTemplateFeature, CirrusSearch\Query\InCategoryFeature, CirrusSearch\Query\IndexedNumericFieldFeature, CirrusSearch\Query\LanguageFeature, CirrusSearch\Query\LinksToFeature, CirrusSearch\Query\PageIdFeature, CirrusSearch\Query\PrefixFeature, CirrusSearch\Query\SubPageOfFeature, and CirrusSearch\Query\TextFieldFilterFeature.


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