mirror of
https://github.com/django/django.git
synced 2025-08-08 12:58:37 +00:00
[5.0.x] Added missing pycon directives in various docs.
Backport of 718b32c691
from main
This commit is contained in:
parent
8b18e0bb3b
commit
415ef34c4c
11 changed files with 295 additions and 130 deletions
|
@ -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:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue