Skip to content

feat(search): expand CJK full-text search to Japanese and Korean - #1734

Open
mariusvniekerk wants to merge 2 commits into
mainfrom
t3code/rebrand-east-asian-full-text
Open

feat(search): expand CJK full-text search to Japanese and Korean#1734
mariusvniekerk wants to merge 2 commits into
mainfrom
t3code/rebrand-east-asian-full-text

Conversation

@mariusvniekerk

Copy link
Copy Markdown
Collaborator

Japanese and Korean message searches now preserve character order and adjacency within each search term. Previously, the Chinese query segmenter could make かな match なか, or make Korean 검색 match separate occurrences of and .

Rename the optional SQLite feature to CJK full-text search, including make install-cjk-fts, its workflow, tables, triggers, and fingerprint identifiers. The feature has not shipped, so the schema definitions use the new names directly without migration code for the earlier names.

Queries containing kana or Hangul use character phrases. Han-only queries retain Chinese word segmentation; Japanese kanji-only searches can use explicit quoted phrases. This remains SQLite message search, without Japanese or Korean grammatical analysis. The query behavior lives in internal/db/cjk_fts_search.go.

Japanese and Korean searches previously matched characters in the wrong
order or scattered across a message. Preserve each term as a character
phrase when the query contains kana or Hangul, while keeping Chinese
word segmentation for Han-only queries.

Use the CJK name in documentation, install commands, and runtime messages
to reflect the broader support. Keep stored index names and fingerprints
stable so the rename does not force an index rebuild.
Use CJK names for the optional search tables, triggers, and fingerprint
identifiers so the storage schema matches the feature's language scope.
The feature has not shipped, so update its definitions directly without
migration code or aliases for the earlier Chinese-specific names.
@roborev-ci

roborev-ci Bot commented Sep 11, 2026

Copy link
Copy Markdown

roborev: Combined Review (631d647)

Verdict: Changes require fixes for 1 finding.

Medium

  • internal/db/cjk_fts_runtime.go:262-290: Renaming the optional index and freshness ledger from messages_chinese_* to messages_cjk_* does not migrate or remove the legacy tables and persistent triggers. Existing archives retain a duplicate index, and old session triggers continue writing to the obsolete ledger; DropFTS also leaves these artifacts behind. Detect legacy names during initialization and atomically rename/migrate them or drop the derived legacy index, ledger, and triggers before creating the new schema. Include legacy cleanup in DropFTS.

    Reported by: codex


Reviewers: 2 done | Synthesis: codex, 7s | Total: 5m43s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant