refactor(search): delete the date-keyword-phrase pre-parse rewrite

whoosh-compat's grammar already accepts the closed multi-word date
keyword vocabulary (previous month, this year, etc.) unquoted after a
date field, making _quote_date_keyword_phrases redundant. Like its
sibling rewrite removed in an earlier commit, it was not quote-aware
and could insert quotes mid-phrase inside an unrelated quoted string
(e.g. title:"see added:previous month notes"), corrupting the parse.
Deleting it removes that hazard entirely.

Docs are adjusted to scope the quoted-or-unquoted equivalence to the
documented keyword list; other date expressions the grammar accepts
(relative offsets, absolute dates) still require quoting.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
stumpylog
2026-08-20 08:27:07 -07:00
co-authored by Claude Opus 5
parent 0fb36dae43
commit 7fddad849a
4 changed files with 84 additions and 66 deletions
+5 -3
View File
@@ -936,9 +936,11 @@ continues past where stemming cuts a word off cannot match at all:
Matching natural date keywords:
Multi-word date keywords work quoted or unquoted after a date field
(`added:"previous month"` and `added:previous month` are equivalent);
elsewhere in a query the same words are treated as ordinary search text.
The multi-word date keywords listed below work quoted or unquoted after a
date field (`added:"previous month"` and `added:previous month` are
equivalent); elsewhere in a query the same words are treated as ordinary
search text. Other date expressions the parser accepts (relative offsets
like `-1 week`, or specific dates like `12 december 2019`) must be quoted.
```
added:today