aboutsummaryrefslogtreecommitdiffstats
path: root/docs/api-guide
diff options
context:
space:
mode:
authorTom Christie2013-05-14 10:16:00 +0100
committerTom Christie2013-05-14 10:16:00 +0100
commitaa0dcd2e4a9df80aa5e0c915a471e97245627a37 (patch)
tree379c45418946b2ee5b1b05540a9f24cb7f06970c /docs/api-guide
parentb2bf5f1f886d131957f99308a0da89b24b3352d4 (diff)
downloaddjango-rest-framework-aa0dcd2e4a9df80aa5e0c915a471e97245627a37.tar.bz2
More docs on SearchFilter
Diffstat (limited to 'docs/api-guide')
-rw-r--r--docs/api-guide/filtering.md12
1 files changed, 11 insertions, 1 deletions
diff --git a/docs/api-guide/filtering.md b/docs/api-guide/filtering.md
index d6798029..94244301 100644
--- a/docs/api-guide/filtering.md
+++ b/docs/api-guide/filtering.md
@@ -198,7 +198,17 @@ You can also perform a related lookup on a ForeignKey or ManyToManyField with th
search_fields = ('username', 'email', 'profile__profession')
-By default, searches will use case-insensitive partial matches. If the search parameter contains multiple whitespace seperated words, then objects will be returned in the list only if all the provided words are matched.
+By default, searches will use case-insensitive partial matches. The search parameter may contain multiple search terms, which should be whitespace and/or comma seperated. If multiple search terms are used then objects will be returned in the list only if all the provided terms are matched.
+
+The search behavior may be restricted by prepending various characters to the `search_fields`.
+
+* '^' Starts-with search.
+* '=' Exact matches.
+* '@' Full-text search. (Currently only supported Django's MySQL backend.)
+
+For example:
+
+ search_fields = ('=username', '=email')
For more details, see the [Django documentation][search-django-admin].