From 58c2c8eb7f1480a89145632b9b820503d898b8a5 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 13 Jan 2024 18:18:56 -0600 Subject: [PATCH] EventsDB: index badges in FTS --- src/storages/events-db.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/storages/events-db.ts b/src/storages/events-db.ts index f6ed16f..f5c4384 100644 --- a/src/storages/events-db.ts +++ b/src/storages/events-db.ts @@ -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 };