EventsDB: index badges in FTS

This commit is contained in:
Alex Gleason 2024-01-13 18:18:56 -06:00
parent 8b3aee7e48
commit 58c2c8eb7f
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 7 additions and 0 deletions

View File

@ -400,6 +400,8 @@ function buildSearchContent(event: Event): string {
return buildUserSearchContent(event as Event<0>);
case 1:
return event.content;
case 30009:
return buildTagsSearchContent(event.tags.filter(([t]) => t !== 'alt'));
default:
return '';
}
@ -411,4 +413,9 @@ function buildUserSearchContent(event: Event<0>): string {
return [name, nip05, about].filter(Boolean).join('\n');
}
/** Build search content from tag values. */
function buildTagsSearchContent(tags: string[][]): string {
return tags.map(([_tag, value]) => value).join('\n');
}
export { EventsDB };