Unify searchindex table with engagement table

This commit is contained in:
Michael 2024-02-01 23:08:53 +00:00
parent 8ddc71188f
commit fc22a3e83f
11 changed files with 79 additions and 48 deletions

View file

@ -154,7 +154,7 @@ class Search extends BaseApi
$table = 'tag-search-view';
} else {
$q = Post\Engagement::escapeKeywords($q);
$condition = ["MATCH (`searchtext`) AGAINST (? IN BOOLEAN MODE) and (private = ? OR `uri-id` in (SELECT `uri-id` FROM `post-user` where `uid` = ?))", $q, Item::PUBLIC, $uid];
$condition = ["MATCH (`searchtext`) AGAINST (? IN BOOLEAN MODE) AND (NOT `restricted` OR `uri-id` IN (SELECT `uri-id` FROM `post-user` WHERE `uid` = ?))", $q, $uid];
$table = 'post-searchindex';
}