mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-08-19 09:13:24 +00:00
"added:previous month" returned HTTP 400 after the whoosh-compat migration. The unquoted spelling was never parser-native anywhere: v2 rewrote it to explicit bracket ranges app-side before whoosh saw the string, and the deleted translation layer consumed it itself, so users and saved views have relied on it continuously while whoosh-compat deliberately scopes it out of its parser (its DIVERGENCES.md entry 19) and understands the phrases natively only as quoted values. parse_user_query now quotes the closed six-phrase vocabulary (previous week/month/quarter/year, this month/year) when it directly follows a date field's colon, before parsing. Only quoting happens app-side; every date computation stays in whoosh-compat's grammar, unlike v2's rewrite, which computed the ranges itself. Date field names derive from PUBLIC_FIELDS, the field name matches case-sensitively (the parser's own field tagging is case-sensitive), the phrase case-insensitively (the grammar accepts any case in the quoted form), and already-quoted spellings, TEXT fields, unfielded words and bracketed ranges are untouched. The previously xfailed end-to-end regression test now passes as a plain test, and a new acceptance class pins unquoted == quoted == mixed-case result sets on a boundary fixture, no-error parsing for the whole vocabulary across all three date fields, and that "title:previous month" stays an ordinary text search. docs/usage.md now states the two spellings are equivalent after a date field. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WMsn6DgzbvSqh1pwy66VVF