diff options
| author | kamtschatka <sschatka@gmail.com> | 2024-06-09 20:11:23 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-09 19:11:23 +0100 |
| commit | 546139e82f151b35d6492b7cbf2ac89dbfd5d0b5 (patch) | |
| tree | aa966a810f68ec79afbb4fd606adaa6bd49538e3 /apps | |
| parent | be1bb388924f4422058099dcb0debdd1c857d36a (diff) | |
| download | karakeep-546139e82f151b35d6492b7cbf2ac89dbfd5d0b5.tar.zst | |
fix: Trigger search re-index on bookmark tag manual updates. Fixes #208 (#210)
* re-index of database is not scanning all places when bookmark tags are changed. Manual indexing is working as workaround #208
introduced a new function to trigger a reindex to reduce copy/paste
added missing reindexes when tags are deleted/bookmarks are updated
* give functions a bit more descriptive name
---------
Co-authored-by: kamtschatka <simon.schatka@gmx.at>
Co-authored-by: MohamedBassem <me@mbassem.com>
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/workers/crawlerWorker.ts | 7 | ||||
| -rw-r--r-- | apps/workers/openaiWorker.ts | 7 |
2 files changed, 4 insertions, 10 deletions
diff --git a/apps/workers/crawlerWorker.ts b/apps/workers/crawlerWorker.ts index f2e0e4a8..58f1aa85 100644 --- a/apps/workers/crawlerWorker.ts +++ b/apps/workers/crawlerWorker.ts @@ -39,7 +39,7 @@ import { LinkCrawlerQueue, OpenAIQueue, queueConnectionDetails, - SearchIndexingQueue, + triggerSearchReindex, zCrawlLinkRequestSchema, } from "@hoarder/shared/queues"; @@ -490,10 +490,7 @@ async function runCrawler(job: Job<ZCrawlLinkRequest, void>) { } // Update the search index - SearchIndexingQueue.add("search_indexing", { - bookmarkId, - type: "index", - }); + triggerSearchReindex(bookmarkId); // Do the archival as a separate last step as it has the potential for failure if (serverConfig.crawler.fullPageArchive) { diff --git a/apps/workers/openaiWorker.ts b/apps/workers/openaiWorker.ts index 7b74e4c3..776d6828 100644 --- a/apps/workers/openaiWorker.ts +++ b/apps/workers/openaiWorker.ts @@ -17,7 +17,7 @@ import logger from "@hoarder/shared/logger"; import { OpenAIQueue, queueConnectionDetails, - SearchIndexingQueue, + triggerSearchReindex, zOpenAIRequestSchema, } from "@hoarder/shared/queues"; @@ -396,8 +396,5 @@ async function runOpenAI(job: Job<ZOpenAIRequest, void>) { await connectTags(bookmarkId, tags, bookmark.userId); // Update the search index - SearchIndexingQueue.add("search_indexing", { - bookmarkId, - type: "index", - }); + triggerSearchReindex(bookmarkId); } |
