diff --git a/apps/workers/searchWorker.ts b/apps/workers/searchWorker.ts index fd0514d6..f793f3f6 100644 --- a/apps/workers/searchWorker.ts +++ b/apps/workers/searchWorker.ts @@ -95,6 +95,7 @@ async function runIndex( : undefined), ...(bookmark.text ? { content: bookmark.text.text } : undefined), note: bookmark.note, + summary: bookmark.summary, title: bookmark.title, createdAt: bookmark.createdAt.toISOString(), tags: bookmark.tagsOnBookmarks.map((t) => t.tag.name), diff --git a/packages/shared/search.ts b/packages/shared/search.ts index 555f0cdb..7474a51d 100644 --- a/packages/shared/search.ts +++ b/packages/shared/search.ts @@ -16,6 +16,7 @@ export const zBookmarkIdxSchema = z.object({ fileName: z.string().nullish(), createdAt: z.string().nullish(), note: z.string().nullish(), + summary: z.string().nullish(), tags: z.array(z.string()).default([]), }); diff --git a/packages/trpc/routers/bookmarks.ts b/packages/trpc/routers/bookmarks.ts index c5147c70..80dd4bec 100644 --- a/packages/trpc/routers/bookmarks.ts +++ b/packages/trpc/routers/bookmarks.ts @@ -994,7 +994,7 @@ export const bookmarksAppRouter = router({ }); } const bookmark = await ctx.db.query.bookmarkLinks.findFirst({ - where: and(eq(bookmarks.id, input.bookmarkId)), + where: eq(bookmarkLinks.id, input.bookmarkId), }); if (!bookmark) { @@ -1032,6 +1032,7 @@ Content: ${bookmark.content ?? ""} summary: summary.response, }) .where(eq(bookmarks.id, input.bookmarkId)); + await triggerSearchReindex(input.bookmarkId); return { bookmarkId: input.bookmarkId,