aboutsummaryrefslogtreecommitdiffstats
path: root/packages/shared
diff options
context:
space:
mode:
authorkamtschatka <sschatka@gmail.com>2024-06-09 20:11:23 +0200
committerGitHub <noreply@github.com>2024-06-09 19:11:23 +0100
commit546139e82f151b35d6492b7cbf2ac89dbfd5d0b5 (patch)
treeaa966a810f68ec79afbb4fd606adaa6bd49538e3 /packages/shared
parentbe1bb388924f4422058099dcb0debdd1c857d36a (diff)
downloadkarakeep-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 'packages/shared')
-rw-r--r--packages/shared/queues.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/shared/queues.ts b/packages/shared/queues.ts
index 86ca32c5..2b890755 100644
--- a/packages/shared/queues.ts
+++ b/packages/shared/queues.ts
@@ -69,3 +69,17 @@ export const SearchIndexingQueue = new Queue<ZSearchIndexingRequest, void>(
},
},
);
+
+export function triggerSearchReindex(bookmarkId: string) {
+ SearchIndexingQueue.add("search_indexing", {
+ bookmarkId,
+ type: "index",
+ });
+}
+
+export function triggerSearchDeletion(bookmarkId: string) {
+ SearchIndexingQueue.add("search_indexing", {
+ bookmarkId: bookmarkId,
+ type: "delete",
+ });
+}