mirror of https://github.com/django/django.git
[2.0.x] Made SearchQuery examples less sterotyped.
Backport of 346eb32861
from master
This commit is contained in:
parent
c678ff91b1
commit
9a2c2b7a68
|
@ -80,9 +80,9 @@ looks for matches for all of the resulting terms.
|
||||||
``SearchQuery`` terms can be combined logically to provide more flexibility::
|
``SearchQuery`` terms can be combined logically to provide more flexibility::
|
||||||
|
|
||||||
>>> from django.contrib.postgres.search import SearchQuery
|
>>> from django.contrib.postgres.search import SearchQuery
|
||||||
>>> SearchQuery('potato') & SearchQuery('ireland') # potato AND ireland
|
>>> SearchQuery('meat') & SearchQuery('cheese') # AND
|
||||||
>>> SearchQuery('potato') | SearchQuery('penguin') # potato OR penguin
|
>>> SearchQuery('meat') | SearchQuery('cheese') # OR
|
||||||
>>> ~SearchQuery('sausage') # NOT sausage
|
>>> ~SearchQuery('meat') # NOT
|
||||||
|
|
||||||
See :ref:`postgresql-fts-search-configuration` for an explanation of the
|
See :ref:`postgresql-fts-search-configuration` for an explanation of the
|
||||||
``config`` parameter.
|
``config`` parameter.
|
||||||
|
|
Loading…
Reference in New Issue