mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-10-22 03:34:24 +03:00
Merge 227b72fd26
into 9b3d03a3d2
This commit is contained in:
commit
8b4da44851
|
@ -230,6 +230,7 @@ The search behavior may be specified by prefixing field names in `search_fields`
|
|||
| `$` | `iregex` | Regex search. |
|
||||
| `@` | `search` | Full-text search (Currently only supported Django's [PostgreSQL backend][postgres-search]). |
|
||||
| None | `icontains` | Contains search (Default). |
|
||||
| `&` | `unaccent` | Accent-insensitive search. (Currently only supported Django's [PostgreSQL backend][postgres-lookups]). |
|
||||
|
||||
For example:
|
||||
|
||||
|
@ -370,3 +371,4 @@ The [djangorestframework-word-filter][django-rest-framework-word-search-filter]
|
|||
[HStoreField]: https://docs.djangoproject.com/en/stable/ref/contrib/postgres/fields/#hstorefield
|
||||
[JSONField]: https://docs.djangoproject.com/en/stable/ref/models/fields/#django.db.models.JSONField
|
||||
[postgres-search]: https://docs.djangoproject.com/en/stable/ref/contrib/postgres/search/
|
||||
[postgres-lookups]: https://docs.djangoproject.com/en/stable/ref/contrib/postgres/lookups/#unaccent
|
||||
|
|
|
@ -68,6 +68,7 @@ class SearchFilter(BaseFilterBackend):
|
|||
'=': 'iexact',
|
||||
'@': 'search',
|
||||
'$': 'iregex',
|
||||
'&': 'unaccent',
|
||||
}
|
||||
search_title = _('Search')
|
||||
search_description = _('A search term.')
|
||||
|
|
Loading…
Reference in New Issue
Block a user