mirror of
https://github.com/friendica/friendica
synced 2025-04-29 03:04:22 +02:00
Expiry post search index entries
This commit is contained in:
parent
919f97c9a0
commit
6389133575
12 changed files with 397 additions and 299 deletions
|
@ -169,6 +169,9 @@ class Engagement
|
|||
$post = Post::selectFirstPost(['uri-id', 'network', 'title', 'content-warning', 'body', 'private',
|
||||
'author-id', 'author-contact-type', 'author-nick', 'author-addr', 'author-gsid',
|
||||
'owner-id', 'owner-contact-type', 'owner-nick', 'owner-addr', 'owner-gsid'], ['uri-id' => $uri_id]);
|
||||
if (empty($post['uri-id'])) {
|
||||
return '';
|
||||
}
|
||||
return self::getSearchTextForItem($post);
|
||||
}
|
||||
|
||||
|
@ -316,7 +319,7 @@ class Engagement
|
|||
public static function escapeKeywords(string $fullTextSearch): string
|
||||
{
|
||||
foreach (Engagement::KEYWORDS as $keyword) {
|
||||
$fullTextSearch = preg_replace('~(' . $keyword . '):(.[\w\*@\.-]+)~', '$1_$2', $fullTextSearch);
|
||||
$fullTextSearch = preg_replace('~(' . $keyword . '):(.[\w\*@\.-]+)~', '"$1_$2"', $fullTextSearch);
|
||||
}
|
||||
return $fullTextSearch;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue