mirror of
https://github.com/friendica/friendica
synced 2025-04-28 13:44:25 +02:00
Include more field in the fulltext search
This commit is contained in:
parent
dfeae25e6d
commit
86592daaa1
3 changed files with 11 additions and 3 deletions
|
@ -31,7 +31,7 @@ class ItemContent
|
|||
{
|
||||
public static function getURIIdListBySearch(string $search, int $uid = 0, int $start = 0, int $limit = 100)
|
||||
{
|
||||
$condition = ["`uri-id` IN (SELECT `uri-id` FROM `item-content` WHERE MATCH (`body`) AGAINST (? IN BOOLEAN MODE))
|
||||
$condition = ["`uri-id` IN (SELECT `uri-id` FROM `item-content` WHERE MATCH (`title`, `content-warning`, `body`) AGAINST (? IN BOOLEAN MODE))
|
||||
AND (NOT `private` OR (`private` AND `uid` = ?))", $search, $uid];
|
||||
$params = [
|
||||
'order' => ['uri-id' => true],
|
||||
|
@ -50,6 +50,13 @@ class ItemContent
|
|||
return $uriids;
|
||||
}
|
||||
|
||||
public static function countBySearch(string $search, int $uid = 0)
|
||||
{
|
||||
$condition = ["`uri-id` IN (SELECT `uri-id` FROM `item-content` WHERE MATCH (`title`, `content-warning`, `body`) AGAINST (? IN BOOLEAN MODE))
|
||||
AND (NOT `private` OR (`private` AND `uid` = ?))", $search, $uid];
|
||||
return DBA::count('item', $condition);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a message into plaintext for connectors to other networks
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue