mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-08-21 02:03:30 +00:00
_query.py mixed three unrelated responsibilities: the SearchQueryError family (paperless's public error-surface API, re-exported by __init__.py), the actual query rewrite/parse/emit/blend pipeline, and build_permission_filter, which has nothing to do with query parsing and is consumed only by _backend.py. - New _errors.py: SearchQueryError, InvalidDateQuery, InvalidNumberQuery, MultipleSearchQueryErrors, search_query_error_messages. _query.py now imports these instead of defining them. - build_permission_filter moves to _backend.py, next to its one caller (TantivyBackend._build_permission_filter). - __init__.py re-exports the error classes from _errors.py instead of _query.py; the package's public API (documents.search import ...) is unchanged for every caller going through it (views.py etc.). _query.py now reads top-to-bottom as rewrite -> parse -> emit -> blend, matching what parse_user_query's own docstring already claimed the file was.