db/events: only index kind 1 events in search

This commit is contained in:
Alex Gleason 2023-08-30 12:07:29 -05:00
parent 02e1a4ce58
commit 5e9a3dd8d1
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 5 additions and 3 deletions

View File

@ -25,9 +25,11 @@ function insertEvent(event: Event): Promise<void> {
})
.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<string, number> = {};
const tags = event.tags.reduce<Insertable<TagRow>[]>((results, tag) => {