System: ISE / PDFsearch.py Component: ISEpdf quoted-phrase search Date discovered: 2026-09-09 Status: Verified and fixed (patch not yet deployed to Dev/Live)
Quoted phrase search for a capitalized term (e.g. "Ian") returns no matches, even when:
Discovered while testing ISE search against a specific attachment (id_attach 6204, the most recently uploaded PDF at the time), containing discussion of Andrew's friend Ian Rashford.
boardurl reverted by a stale DB-restore step in Andrew's backup pipeline).pdf_store.json and word_index_pdf.json via direct file grep.word_index_pdf.json; the "ian" key's match list correctly includes [6204, 22], [6204, 23], [6204, 24].word_index_pdf.json is lowercase-only at the key level ("ian" exists; "Ian" does not). PDFsearch.py's phrase-mode ("literal") branch does a raw, case-sensitive exact-key lookup against that index ([pw] if pw in word_index else []), which can never match a capitalized query term against an all-lowercase index.PDFsearch.py, search(), phrase-mode branch, line 334 (pre-fix):
matched_keys = [pw] if pw in word_index else []
Word-mode search, by contrast, already folds through a case-insensitive lookup (folded_index.get(term.lower(), [])). Phrase-mode was never updated to match when that folding was introduced (see Risk Analysis report for the likely regression history).
matched_keys = folded_index.get(pw.lower(), [])
One-line change, same file, same function. See attached pdfsearch_v_fix.diff and the Code Change Report for full detail.
Verified via an isolated test harness (test_phrase_bug.py) using the actual tokenise()/search() code from PDFsearch.py (copied verbatim, not reimplemented), run against synthetic index data shaped exactly like the real confirmed word_index_pdf.json structure, including Andrew's real confirmed data for "ian" / attach 6204.
| Query | Mode | Pre-fix finds 6204? | Post-fix finds 6204? |
|---|---|---|---|
Ian |
word | True | True |
"Ian" |
literal | False | True |
"Ian " |
literal | False | True |
"ian" |
literal | True | True |
'"Ian "') reproduce the failure pre-fix and are resolved post-fix.MiscSearch.py / posts-search have not been checked for the same pattern against their own indexes. Case-sensitivity was recorded as "unified across all 3 sources" in an earlier v7.4 checkpoint — that claim has not been re-verified against this specific failure mode.