mirror of
https://github.com/friendica/friendica
synced 2025-04-23 23:50:12 +00:00
Unify searchindex table with engagement table
This commit is contained in:
parent
8ddc71188f
commit
fc22a3e83f
11 changed files with 79 additions and 48 deletions
|
@ -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';
|
||||
}
|
||||
|
||||
|
|
|
@ -324,7 +324,7 @@ class Timeline extends BaseModule
|
|||
} elseif ($this->selectedTab == ChannelEntity::AUDIO) {
|
||||
$condition = ["`media-type` & ?", 4];
|
||||
} elseif ($this->selectedTab == ChannelEntity::LANGUAGE) {
|
||||
$condition = ["JSON_EXTRACT(JSON_KEYS(language), '$[0]') = ?", User::getLanguageCode($uid)];
|
||||
$condition = ["`iso-639-1` = ?", User::getLanguageCode($uid)];
|
||||
} elseif (is_numeric($this->selectedTab)) {
|
||||
$condition = $this->getUserChannelConditions($this->selectedTab, $uid);
|
||||
}
|
||||
|
@ -450,7 +450,7 @@ class Timeline extends BaseModule
|
|||
$conditions = [];
|
||||
$languages = $languages ?: User::getWantedLanguages($uid);
|
||||
foreach ($languages as $language) {
|
||||
$conditions[] = "JSON_EXTRACT(JSON_KEYS(language), '$[0]') = ?";
|
||||
$conditions[] = "`iso-639-1` = ?";
|
||||
$condition[] = $language;
|
||||
}
|
||||
if (!empty($conditions)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue