Skip to content

Commit 9c07e1f

Browse files
authored
Update Collection.php
1 parent 3a545f5 commit 9c07e1f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Model/ResourceModel/Post/Collection.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,10 @@ public function addSearchFilter($term)
410410
$tagPostIds = array_slice($tagPostIds, 0, 200);
411411
}
412412

413-
$fullExpression = $this->getSearchRateExpression($term, $this->_ftiCollumns) .
414-
'+ IF(main_table.post_id IN (' . implode(',', $tagPostIds) . '), "1", "0"))';
413+
$fullExpression = $this->getSearchRateExpression($term, $this->_ftiCollumns);
414+
$fullExpression = substr($fullExpression, 0, strrpos($fullExpression, ')'));
415+
$fullExpression = $fullExpression .
416+
' + IF(main_table.post_id IN (' . implode(',', $tagPostIds) . '), "1", "0"))';
415417

416418
$fullExpression = new \Zend_Db_Expr($fullExpression);
417419
$this->getSelect()->columns(['search_rate' => $fullExpression]);

0 commit comments

Comments
 (0)