feat: rebuild search index

This commit is contained in:
2026-02-11 09:43:13 +01:00
parent 0b5efbb5e1
commit c7827a2d77
6 changed files with 84 additions and 0 deletions

View File

@@ -302,6 +302,13 @@ const App: React.FC = () => {
}) || (() => {})
);
unsubscribers.push(
window.electronAPI?.on('menu:reindexText', () => {
// Fire and forget - runs as a background task
window.electronAPI?.posts.reindexText();
}) || (() => {})
);
return () => {
unsubscribers.forEach(unsub => unsub());
};

View File

@@ -149,6 +149,7 @@ export interface ElectronAPI {
discard: (id: string) => Promise<PostData | null>;
hasPublishedVersion: (id: string) => Promise<boolean>;
rebuildFromFiles: () => Promise<void>;
reindexText: () => Promise<void>;
search: (query: string) => Promise<SearchResult[]>;
filter: (filter: PostFilter) => Promise<PostData[]>;
getTags: () => Promise<string[]>;