Simplify SQL check

This commit is contained in:
Michael 2024-01-11 20:40:24 +00:00
parent cc0b16c0ae
commit 62975b0ef2

View file

@ -156,10 +156,7 @@ class UserDefinedChannel extends \Friendica\BaseRepository
return true;
}
$this->db->insert('check-full-text-search', ['pid' => getmypid(), 'searchtext' => $searchtext], Database::INSERT_UPDATE);
$result = $this->db->select('check-full-text-search', [], ["`pid` = ? AND MATCH (`searchtext`) AGAINST (? IN BOOLEAN MODE)", getmypid(), $this->escapeKeywords($searchtext)]);
$this->db->delete('check-full-text-search', ['pid' => getmypid()]);
return $result !== false;
return $this->db->select('check-full-text-search', [], ["`pid` = ? AND MATCH (`searchtext`) AGAINST (? IN BOOLEAN MODE)", getmypid(), $this->escapeKeywords($searchtext)]) !== false;
}
/**