diff --git a/src/documents/search/_backend.py b/src/documents/search/_backend.py index eb38fe58b..df2b73f7d 100644 --- a/src/documents/search/_backend.py +++ b/src/documents/search/_backend.py @@ -670,6 +670,10 @@ class TantivyBackend: frequency (how many documents contain each word). Optionally filters results to only words from documents visible to the specified user. + NOTE: This is the hottest search path (called per keystroke). + A future improvement would be to cache results in Redis, keyed by + (prefix, user_id), and invalidate on index writes. + Args: term: Prefix to match against autocomplete words limit: Maximum number of suggestions to return