mirror of
https://github.com/friendica/friendica
synced 2025-04-29 13:44:23 +02:00
Option to reduced search scope to improve the performance
This commit is contained in:
parent
d7e038a014
commit
259a676207
11 changed files with 349 additions and 260 deletions
|
@ -124,7 +124,7 @@ class Content
|
|||
'limit' => [$start, $limit]
|
||||
];
|
||||
|
||||
$tags = DBA::select('post-searchindex', ['uri-id'], $condition, $params);
|
||||
$tags = DBA::select(SearchIndex::getSearchTable(), ['uri-id'], $condition, $params);
|
||||
|
||||
$uriids = [];
|
||||
while ($tag = DBA::fetch($tags)) {
|
||||
|
@ -143,6 +143,6 @@ class Content
|
|||
} else {
|
||||
$condition = ["MATCH (`searchtext`) AGAINST (? IN BOOLEAN MODE) AND NOT `restricted", $search];
|
||||
}
|
||||
return DBA::count('post-searchindex', $condition);
|
||||
return DBA::count(SearchIndex::getSearchTable(), $condition);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -99,4 +99,14 @@ class SearchIndex
|
|||
}
|
||||
return DateTimeFormat::utc('now - ' . $days . ' day');
|
||||
}
|
||||
|
||||
public static function getSearchTable(): string
|
||||
{
|
||||
return DI::config()->get('system', 'limited_search_scope') ? 'post-engagement' : 'post-searchindex';
|
||||
}
|
||||
|
||||
public static function getSearchView(): string
|
||||
{
|
||||
return DI::config()->get('system', 'limited_search_scope') ? 'post-engagement-user-view' : 'post-searchindex-user-view';
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue