$this->
addToleranceCondition($query);
$query->
select( [ 'a.id as product_id',
'(' .
$this->
getRelevanceSelection() . ') as ranking',
] );
$enableAndSearchLogic =
$this->config->
get('enableAndSearchLogic', false
);
if ($enableAndSearchLogic) { $this->
addAndSearchLogic($query,
$term);
} return $query;
} /**
* @return string
*/
private function getRelevanceSelection() { return 'sr.relevance
+ IF(a.topseller = 1, 50, 0)
+ IF(a.datum >= DATE_SUB(NOW(),INTERVAL 7 DAY), 25, 0)';