Enhance search functionality with regex, FTS5, snippets, and sorting#252
Enhance search functionality with regex, FTS5, snippets, and sorting#252jesserobbins wants to merge 4 commits intowesm:mainfrom
Conversation
…et support, sorting - Use word-boundary regex (\b) for text search to match whole words only - Add FTS5 prefix matching (*) for partial word matches in deep search - Include snippet field in fast search so body text matches appear in TUI - Add MessageSorting parameter to Search and SearchFast methods - Add escapeRegex helper function for DuckDB regex pattern escaping Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
roborev: Combined Review (
|
…et support - Use word-boundary regex (\b) for text search to match whole words only - Add FTS5 prefix matching (*) for partial word matches in deep search - Include snippet field in fast search so body text matches appear in TUI - Add escapeRegex helper function for DuckDB regex pattern escaping Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
|
Removed the incomplete sort stuff |
roborev: Combined Review (
|
- Always quote FTS5 search terms to prevent special characters (-, :, (, )) from being parsed as query syntax - Only apply \b word boundary in DuckDB regex when term starts with a word character — non-word-leading terms (+, @, #) skip \b since it requires a word/non-word transition that fails at string start - Update stale tests that still expected ILIKE patterns Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- TestSearch_WithFTS_SpecialChars: verifies FTS5 search with -, :, () doesn't cause syntax errors (previously unquoted terms were parsed as FTS5 operators) - TestBuildWhereClause_WordBoundaryPrefix: verifies \b is applied only for word-char-leading terms, and non-word-leading terms (+, @, #, () skip the word boundary prefix Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
roborev: Combined Review (
|
Fix and Improve search accuracy and performance across full-text, fast (Parquet), and aggregate query paths with word-boundary matching, better snippet handling, and consistent result sorting.
Problem
While importing my old 1990's era email archives, I discovered a number of issues with search
Proposed Solution
Changes
snippet inclusion, sort parameter, escapeRegex helper
Testing
substring matches