mirror of
https://github.com/openvk/openvk
synced 2024-11-11 01:19:53 +03:00
Search hashtags via word index (#655)
This commit is contained in:
parent
b117d0fe01
commit
d02cef93ee
2 changed files with 2 additions and 1 deletions
|
@ -71,7 +71,7 @@ class Posts
|
|||
{
|
||||
$hashtag = "#$hashtag";
|
||||
$sel = $this->posts
|
||||
->where("content LIKE ?", "%$hashtag%")
|
||||
->where("MATCH (content) AGAINST (? IN BOOLEAN MODE)", "+$hashtag")
|
||||
->where("deleted", 0)
|
||||
->order("created DESC")
|
||||
->page($page, $perPage ?? OPENVK_DEFAULT_PER_PAGE);
|
||||
|
|
1
install/sqls/00029-hashtag-search.sql
Normal file
1
install/sqls/00029-hashtag-search.sql
Normal file
|
@ -0,0 +1 @@
|
|||
ALTER TABLE `posts` ADD FULLTEXT `content` (`content`);
|
Loading…
Reference in a new issue