Conversation
added 5 commits
September 17, 2026 21:03
…sort filters (bytefolk#68) - Internal GET /api/doc and API v1 GET /api/v1/documents now search both title and content (OR) instead of title-only - Add after/before query params for updatedAt range filtering - Add sort query param (updated_desc|updated_asc|created_desc|created_asc) - No schema migration needed — uses Prisma OR + contains
…or pagination - Extract shared doc-query.ts module for query parsing and where/orderBy builders - Fix getOrderBy to return mutable array (TS2322 build failure) - Add mode: insensitive to /api/doc title search for consistency with v1 - Return 400 for invalid date/sort params instead of silently ignoring - Disable cursor pagination for created_* sort orders (cursor is updatedAt-based) - Unify search/date/sort logic between /api/doc and /api/v1/documents
…ytefolk#71) - Add `contentSearch` column to persist plain-text extraction of TipTap content - Add `search_vector` tsvector column with GIN index, maintained by trigger - Use `websearch_to_tsquery()` for indexed retrieval when available - Report `matchField` (title | content | both) in search results - Keep `contains` fallback for SQLite/unmigrated environments - Update collaboration service to populate `contentSearch` on save
waterbro-8
reviewed
Sep 18, 2026
waterbro-8
left a comment
There was a problem hiding this comment.
Indexed matchField + search_vector is the right follow-on for #71.
Please rebase onto current main after #69 (content search + time/sort). This PR overlaps src/lib/doc-query.ts, src/lib/api-v1-documents.ts, src/app/api/doc/route.ts, and the v1 list tests. Landing both without a rebase will conflict; keep this PR additive (contentSearch column, tsvector/GIN, matchField, collaboration extractor).
fullTextSearch parameterizes websearch_to_tsquery via $queryRawUnsafe placeholders — that part looks fine. I cannot push sun-970/doc.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #71
Summary
contentSearchcolumn to persist plain-text extraction of TipTap contentsearch_vectortsvector column with GIN index, maintained by triggerwebsearch_to_tsquery()for indexed retrieval when availablematchField(title | content | both) in search resultscontainsfallback for SQLite/unmigrated environmentscontentSearchon saveTest plan