feat: add files notes and search

This commit is contained in:
2026-07-18 16:03:06 +08:00
parent 530fc43cca
commit b7fb1969e6
6 changed files with 206 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
CREATE INDEX IF NOT EXISTS idx_notes_search
ON notes
USING gin (to_tsvector('simple', coalesce(title, '') || ' ' || coalesce(markdown, '')));
CREATE INDEX IF NOT EXISTS idx_sources_search
ON sources
USING gin (to_tsvector('simple', coalesce(title, '') || ' ' || coalesce(url, '') || ' ' || coalesce(content_text, '')));
CREATE INDEX IF NOT EXISTS idx_inbox_items_search
ON inbox_items
USING gin (to_tsvector('simple', coalesce(title, '') || ' ' || coalesce(body, '')));
CREATE INDEX IF NOT EXISTS idx_tasks_search
ON tasks
USING gin (to_tsvector('simple', coalesce(title, '') || ' ' || coalesce(description, '')));
CREATE INDEX IF NOT EXISTS idx_ai_sessions_search
ON ai_sessions
USING gin (to_tsvector('simple', coalesce(title, '') || ' ' || coalesce(context, '')));