summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Aglassinger <zz.github@roskakori.at>2022-01-28 06:36:39 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-01-28 06:37:14 +0100
commit9a9c5b402b2509fab4ae40c4e73a13c18bbd7b01 (patch)
tree969998f57f57bff54968679f7594ff46cced03ab
parent7c2d4d943b2905a8cfbb2d2f6c6fa15983b23ff1 (diff)
downloaddjango-9a9c5b402b2509fab4ae40c4e73a13c18bbd7b01.tar.gz
[4.0.x] Fixed #33459 -- Clarified index type in full text search docs.
Backport of 3a9b8b25d48c5768633e73edc5ddca20c3fd716c from main
-rw-r--r--docs/ref/contrib/postgres/search.txt10
1 files changed, 8 insertions, 2 deletions
diff --git a/docs/ref/contrib/postgres/search.txt b/docs/ref/contrib/postgres/search.txt
index cfed877d9c..fa369670bb 100644
--- a/docs/ref/contrib/postgres/search.txt
+++ b/docs/ref/contrib/postgres/search.txt
@@ -255,8 +255,14 @@ run into performance problems. Full text search is a more intensive process
than comparing the size of an integer, for example.
In the event that all the fields you're querying on are contained within one
-particular model, you can create a functional index which matches the search
-vector you wish to use. The PostgreSQL documentation has details on
+particular model, you can create a functional
+:class:`GIN <django.contrib.postgres.indexes.GinIndex>` or
+:class:`GiST <django.contrib.postgres.indexes.GistIndex>` index which matches
+the search vector you wish to use. For example::
+
+ GinIndex(SearchVector('body_text'), name='body_search_vector_idx')
+
+The PostgreSQL documentation has details on
`creating indexes for full text search
<https://www.postgresql.org/docs/current/textsearch-tables.html#TEXTSEARCH-TABLES-INDEX>`_.