Option to reduced search scope to improve the performance

This commit is contained in:
Michael 2024-06-02 09:27:05 +00:00
parent d7e038a014
commit 259a676207
11 changed files with 349 additions and 260 deletions

View file

@ -28,6 +28,7 @@ use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Item;
use Friendica\Model\Post;
use Friendica\Model\Post\SearchIndex;
use Friendica\Model\Tag;
use Friendica\Module\BaseApi;
use Friendica\Util\Network;
@ -159,7 +160,7 @@ class Search extends BaseApi
} else {
$q = Post\Engagement::escapeKeywords($q);
$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';
$table = SearchIndex::getSearchTable();
}
if (!empty($account_id)) {