CirrusSearch
Elasticsearch-powered search for MediaWiki
Loading...
Searching...
No Matches
CirrusSearch\Search\Rescore\FunctionScoreDecorator Class Reference

This is useful to check if the function score is empty Function score builders may not add any function if some criteria are not met. More...

+ Inheritance diagram for CirrusSearch\Search\Rescore\FunctionScoreDecorator:
+ Collaboration diagram for CirrusSearch\Search\Rescore\FunctionScoreDecorator:

Public Member Functions

 addFunction (string $functionType, $functionParams, ?AbstractQuery $filter=null, ?float $weight=null)
 
 isEmptyFunction ()
 
 getSize ()
 

Protected Member Functions

 _getBaseName ()
 Default elastica behaviour is to use class name as property name.
 

Detailed Description

This is useful to check if the function score is empty Function score builders may not add any function if some criteria are not met.

If there's no function we should not not build the rescore query.

Todo
: find another pattern to deal with this problem and avoid this strong dependency to FunctionScore::addFunction signature.

Member Function Documentation

◆ _getBaseName()

CirrusSearch\Search\Rescore\FunctionScoreDecorator::_getBaseName ( )
protected

Default elastica behaviour is to use class name as property name.

We must override this function to force the name to function_score

Returns
string

◆ getSize()

CirrusSearch\Search\Rescore\FunctionScoreDecorator::getSize ( )
Returns
int the number of added functions.

◆ isEmptyFunction()

CirrusSearch\Search\Rescore\FunctionScoreDecorator::isEmptyFunction ( )
Returns
bool true if this function score is empty

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