(backend) allow filtering on document titles

This is the minimal and fast search feature, while we are working on
a full text search based on opensearch. For the moment we only search
on the title of the document.
This commit is contained in:
Samuel Paccoud - DINUM
2024-11-15 09:42:27 +01:00
committed by Anthony LC
parent bfbdfb2b5c
commit b5c159bf63
4 changed files with 51 additions and 3 deletions

View File

@@ -326,10 +326,11 @@ class DocumentViewSet(
- `is_creator_me=false`: Returns documents created by other users.
- `is_favorite=true`: Returns documents marked as favorite by the current user
- `is_favorite=false`: Returns documents not marked as favorite by the current user
- `title=hello`: Returns documents which title contains the "hello" string
Example Usage:
- GET /api/v1.0/documents/?is_creator_me=true&is_favorite=true
- GET /api/v1.0/documents/?is_creator_me=false
- GET /api/v1.0/documents/?is_creator_me=false&title=hello
"""
filter_backends = [filters.DjangoFilterBackend, drf_filters.OrderingFilter]