lower the number of characters to trigger a fulltext search

This commit is contained in:
thomas girod 2024-09-17 17:52:39 +02:00
parent 813bbbb94a
commit ab72e01707

View File

@ -54,7 +54,7 @@ class UserFilterSchema(FilterSchema):
def filter_search(self, value: str | None) -> Q: def filter_search(self, value: str | None) -> Q:
if not value: if not value:
return Q() return Q()
if len(value) < 4: if len(value) < 3:
# For small queries, full text search isn't necessary # For small queries, full text search isn't necessary
return ( return (
Q(first_name__istartswith=value) Q(first_name__istartswith=value)