Skip to content

Commit 3b4f5b3

Browse files
committed
Fixed multy fulltext index issue
1 parent 63b7e6b commit 3b4f5b3

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

Model/ResourceModel/Post/Collection.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,13 +224,9 @@ public function addSearchFilter($term)
224224
$this->addExpressionFieldToSelect(
225225
'search_rate',
226226
'(0
227-
+ (MATCH (content) AGAINST ("{{content}}")) * 1
228-
+ (MATCH (short_content) AGAINST ("{{short_content}}")) * 2
229-
+ (MATCH (title) AGAINST ("{{title}}")) * 5)',
227+
+ (MATCH (title, meta_keywords, meta_description, identifier, content) AGAINST ("{{term}}")) * 1)',
230228
[
231-
'content' => $term,
232-
'short_content' => $term,
233-
'title' => $term
229+
'term' => $term,
234230
]
235231
);
236232

Setup/UpgradeSchema.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,8 +679,9 @@ public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $con
679679
);
680680
}
681681

682+
/* remove multi-fulltext, it does not supported in some DB
682683
if (version_compare($version, '2.8.3.1') < 0) {
683-
/* Fix issue https://github.com/magefan/module-blog/issues/205 */
684+
// Fix issue https://github.com/magefan/module-blog/issues/205
684685
$table = $setup->getTable('magefan_blog_post');
685686
foreach (['title', 'content', 'short_content'] as $field) {
686687
$connection->addIndex(
@@ -695,6 +696,8 @@ public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $con
695696
);
696697
}
697698
}
699+
*/
700+
698701
if (version_compare($version, '2.8.4.1') < 0) {
699702
$table = $setup->getTable('magefan_blog_tag');
700703
$connection->addColumn(

0 commit comments

Comments
 (0)