From 5e9a3dd8d17d6e317a049689ab4aab2121802932 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 30 Aug 2023 12:07:29 -0500 Subject: [PATCH] db/events: only index kind 1 events in search --- src/db/events.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/db/events.ts b/src/db/events.ts index 0bedccf..59d831b 100644 --- a/src/db/events.ts +++ b/src/db/events.ts @@ -25,9 +25,11 @@ function insertEvent(event: Event): Promise { }) .execute(); - await trx.insertInto('events_fts') - .values({ id: event.id, content: event.content }) - .execute(); + if (event.kind === 1) { + await trx.insertInto('events_fts') + .values({ id: event.id, content: event.content }) + .execute(); + } const tagCounts: Record = {}; const tags = event.tags.reduce[]>((results, tag) => {