summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/contrib/postgres/search.txt12
-rw-r--r--docs/releases/3.1.txt3
2 files changed, 13 insertions, 2 deletions
diff --git a/docs/ref/contrib/postgres/search.txt b/docs/ref/contrib/postgres/search.txt
index c78183cd01..813a3db57a 100644
--- a/docs/ref/contrib/postgres/search.txt
+++ b/docs/ref/contrib/postgres/search.txt
@@ -80,8 +80,11 @@ looks for matches for all of the resulting terms.
If ``search_type`` is ``'plain'``, which is the default, the terms are treated
as separate keywords. If ``search_type`` is ``'phrase'``, the terms are treated
as a single phrase. If ``search_type`` is ``'raw'``, then you can provide a
-formatted search query with terms and operators. Read PostgreSQL's `Full Text
-Search docs`_ to learn about differences and syntax. Examples:
+formatted search query with terms and operators. If ``search_type`` is
+``'websearch'``, then you can provide a formatted search query, similar to the
+one used by web search engines. ``'websearch'`` requires PostgreSQL ≥ 11. Read
+PostgreSQL's `Full Text Search docs`_ to learn about differences and syntax.
+Examples:
.. _Full Text Search docs: https://www.postgresql.org/docs/current/textsearch-controls.html#TEXTSEARCH-PARSING-QUERIES
@@ -91,6 +94,7 @@ Search docs`_ to learn about differences and syntax. Examples:
>>> SearchQuery('red tomato', search_type='phrase') # a phrase
>>> SearchQuery('tomato red', search_type='phrase') # a different phrase
>>> SearchQuery("'tomato' & ('red' | 'green')", search_type='raw') # boolean operators
+ >>> SearchQuery("'tomato' ('red' OR 'green')", search_type='websearch') # websearch operators
``SearchQuery`` terms can be combined logically to provide more flexibility::
@@ -102,6 +106,10 @@ Search docs`_ to learn about differences and syntax. Examples:
See :ref:`postgresql-fts-search-configuration` for an explanation of the
``config`` parameter.
+.. versionchanged:: 3.1
+
+ Support for ``'websearch'`` search type was added.
+
``SearchRank``
==============
diff --git a/docs/releases/3.1.txt b/docs/releases/3.1.txt
index b98d770ac5..136f2900b8 100644
--- a/docs/releases/3.1.txt
+++ b/docs/releases/3.1.txt
@@ -97,6 +97,9 @@ Minor features
:class:`~django.db.models.SmallIntegerField`, and
:class:`~django.db.models.DecimalField`.
+* :class:`~django.contrib.postgres.search.SearchQuery` now supports
+ ``'websearch'`` search type on PostgreSQL 11+.
+
:mod:`django.contrib.redirects`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~