Repository navigation
feat(search): add opt-in word forms to message search - #242
Merged
Merged
Conversation
…unning it (#92) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…#92) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…emmers' notice Co-Authored-By: Claude Fable 5.2 <[email protected]>
Plain queries expand to the index's forms of each word. A query with FTS5 syntax or --phrase is matched as written, as before, so the two refusals of the opt-in flag are gone. The answer has forms (null when the query was not expanded) and filters.exact. BREAKING CHANGE: tg messages search returns more results for plain words; pass --exact for the previous behaviour. Co-Authored-By: Claude Fable 5.2 <[email protected]>
The forms come from the whole cache's vocabulary, so listing them could show words of chats outside the allowlist. Checking each form against the allowed chats would read every message with that word, so expansion is off while a list is set, as with --exact. Co-Authored-By: Claude Fable 5.2 <[email protected]>
2ms stemmed to 2m, so a search for milliseconds also matched minutes. A word with a digit or a letter of another script is now matched as typed. Co-Authored-By: Claude Fable 5.2 <[email protected]>
The vocabulary lookup reads the folded word, which can be another index word than the one the tokenizer makes of the typed word (a letter typed with a combining mark), so the exact match dropped out. Every group now starts with the word as typed, and the cap of 30 keeps a place for it. Co-Authored-By: Claude Fable 5.2 <[email protected]>
No other word stems to one letter, so scanning every index word with that first letter only cost time. Two-letter words keep the scan: its stems to it, and её reads as ее. Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
…arch-word-forms # Conflicts: # CHANGELOG.md
…arch-word-forms # Conflicts: # CHANGELOG.md
…arch-word-forms # Conflicts: # CHANGELOG.md # src/commands/messages/search.ts # src/db/messages-search.ts Co-Authored-By: Claude Fable 5.2 <[email protected]>
The FTS5 match built for count, the untyped-match check and the search that joins transcript hits passed only the phrase option, so it dropped the word forms: --count disagreed with the results, and forms stopped working once a transcript matched. Co-Authored-By: Claude Fable 5.2 <[email protected]>
findQueryForms read only message_search_vocab, so a form that occurs only in a voice or video note transcript was never searched for. A second fts5vocab table, transcript_search_vocab, is read together with it, summing doc per term. Co-Authored-By: Claude Fable 5.2 <[email protected]>
Plain tg messages search matches each word as typed, as 0.16.0 does. --forms turns word forms on and is refused with FTS5 syntax or --phrase, as in 17b5bd7; --exact and filters.exact are gone, filters.forms is back. While allowedChats is set, --forms doesn't expand and forms is null. The help, docs, skill, changelog and storage.md §9 record the opt-in choice made in review. Co-Authored-By: Claude Fable 5.2 <[email protected]>
A word whose stem has one or two letters (ok, не) scanned every index word that starts with its first letter, and a word with no stem (2026) scanned on its prefix only to keep itself. Both are now exact lookups, the first with е and ё both, so --forms no longer reads a large part of the vocabulary before such a search. it no longer finds its. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…ormula The release workflow copies NOTICE into dist, checksums it with the binaries and uploads it to the GitHub Release. The Homebrew formula takes it as a resource and installs it in the formula's prefix; tap.sh waits for it to download before the audit. Co-Authored-By: Claude Fable 5.2 <[email protected]>
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.
Integrates #216 with its original commits. Closes #92.
Plain searches stay exact. With
--forms, Russian and English words can match other forms in the cache. An active chat allowlist keeps expansion off. The release workflow includes the stemmer NOTICE in the binary release, checksums and Homebrew installation.The final commit makes word forms use the same transcript visibility check as search results. Only current, visible transcripts contribute to the form list, its ranking and its cap. Expansion and results use the same read transaction.
The regression test covers a chat becoming protected, protection being lifted and an attachment being replaced. The regression failed before the fix. Local checks passed, including the search and transcription tests.