summaryrefslogtreecommitdiff
path: root/docs/ref/contrib/postgres
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2023-10-25 12:27:27 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2023-10-25 12:27:56 +0200
commit415ef34c4c2d4e9416ecf04ddf8cfb33585f1934 (patch)
tree12194fbcd557df1cd3ea5099307da032ad360812 /docs/ref/contrib/postgres
parent8b18e0bb3ba8bb1f51e15487a6d5402853e637ae (diff)
[5.0.x] Added missing pycon directives in various docs.
Backport of 718b32c6918037cfc746d7867333d79a3c887a8c from main
Diffstat (limited to 'docs/ref/contrib/postgres')
-rw-r--r--docs/ref/contrib/postgres/search.txt16
1 files changed, 10 insertions, 6 deletions
diff --git a/docs/ref/contrib/postgres/search.txt b/docs/ref/contrib/postgres/search.txt
index 699f81bd11..af9d3ee357 100644
--- a/docs/ref/contrib/postgres/search.txt
+++ b/docs/ref/contrib/postgres/search.txt
@@ -94,13 +94,17 @@ Examples:
.. _Full Text Search docs: https://www.postgresql.org/docs/current/textsearch-controls.html#TEXTSEARCH-PARSING-QUERIES
+.. code-block:: pycon
+
>>> from django.contrib.postgres.search import SearchQuery
- >>> SearchQuery('red tomato') # two keywords
- >>> SearchQuery('tomato red') # same results as above
- >>> 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("red tomato") # two keywords
+ >>> SearchQuery("tomato red") # same results as above
+ >>> 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: