summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorJacob Walls <jacobtylerwalls@gmail.com>2025-09-23 07:14:31 -0400
committerJacob Walls <jacobtylerwalls@gmail.com>2025-09-23 10:09:18 -0400
commitb2773a39a34f0f0ca768fa1daaf8bf72fca56e06 (patch)
treef6759e21fa71d49af2dc592c4e83c429b57839b7 /docs/ref
parent7554c54e5f02566520dee81c8b95f47429f1b553 (diff)
[5.2.x] Refs #25508 -- Used QuerySet.__repr__ in docs/ref/contrib/postgres/search.txt.
Backport of efb96138b4af774c22ae6e949410b45d69960357 from main.
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/contrib/postgres/search.txt22
1 files changed, 11 insertions, 11 deletions
diff --git a/docs/ref/contrib/postgres/search.txt b/docs/ref/contrib/postgres/search.txt
index 220ab4c591..d84f14547c 100644
--- a/docs/ref/contrib/postgres/search.txt
+++ b/docs/ref/contrib/postgres/search.txt
@@ -27,7 +27,7 @@ single column in the database. For example:
.. code-block:: pycon
>>> Entry.objects.filter(body_text__search="Cheese")
- [<Entry: Cheese on Toast recipes>, <Entry: Pizza Recipes>]
+ <QuerySet [<Entry: Cheese on Toast recipes>, <Entry: Pizza Recipes>]>
This creates a ``to_tsvector`` in the database from the ``body_text`` field
and a ``plainto_tsquery`` from the search term ``'Cheese'``, both using the
@@ -52,7 +52,7 @@ To query against both fields, use a ``SearchVector``:
>>> Entry.objects.annotate(
... search=SearchVector("body_text", "blog__tagline"),
... ).filter(search="Cheese")
- [<Entry: Cheese on Toast recipes>, <Entry: Pizza Recipes>]
+ <QuerySet [<Entry: Cheese on Toast recipes>, <Entry: Pizza Recipes>]>
The arguments to ``SearchVector`` can be any
:class:`~django.db.models.Expression` or the name of a field. Multiple
@@ -67,7 +67,7 @@ For example:
>>> Entry.objects.annotate(
... search=SearchVector("body_text") + SearchVector("blog__tagline"),
... ).filter(search="Cheese")
- [<Entry: Cheese on Toast recipes>, <Entry: Pizza Recipes>]
+ <QuerySet [<Entry: Cheese on Toast recipes>, <Entry: Pizza Recipes>]>
See :ref:`postgresql-fts-search-configuration` and
:ref:`postgresql-fts-weighting-queries` for an explanation of the ``config``
@@ -137,7 +137,7 @@ order by relevancy:
>>> vector = SearchVector("body_text")
>>> query = SearchQuery("cheese")
>>> Entry.objects.annotate(rank=SearchRank(vector, query)).order_by("-rank")
- [<Entry: Cheese on Toast recipes>, <Entry: Pizza recipes>]
+ <QuerySet [<Entry: Cheese on Toast recipes>, <Entry: Pizza recipes>]>
See :ref:`postgresql-fts-weighting-queries` for an explanation of the
``weights`` parameter.
@@ -235,7 +235,7 @@ different language parsers and dictionaries as defined by the database:
>>> Entry.objects.annotate(
... search=SearchVector("body_text", config="french"),
... ).filter(search=SearchQuery("œuf", config="french"))
- [<Entry: Pain perdu>]
+ <QuerySet [<Entry: Pain perdu>]>
The value of ``config`` could also be stored in another column:
@@ -245,7 +245,7 @@ The value of ``config`` could also be stored in another column:
>>> Entry.objects.annotate(
... search=SearchVector("body_text", config=F("blog__language")),
... ).filter(search=SearchQuery("œuf", config=F("blog__language")))
- [<Entry: Pain perdu>]
+ <QuerySet [<Entry: Pain perdu>]>
.. _postgresql-fts-weighting-queries:
@@ -313,7 +313,7 @@ if it were an annotated ``SearchVector``:
>>> Entry.objects.update(search_vector=SearchVector("body_text"))
>>> Entry.objects.filter(search_vector="cheese")
- [<Entry: Cheese on Toast recipes>, <Entry: Pizza recipes>]
+ <QuerySet [<Entry: Cheese on Toast recipes>, <Entry: Pizza recipes>]>
.. _PostgreSQL documentation: https://www.postgresql.org/docs/current/textsearch-features.html#TEXTSEARCH-UPDATE-TRIGGERS
@@ -352,7 +352,7 @@ Usage example:
... ).filter(
... similarity__gt=0.3
... ).order_by("-similarity")
- [<Author: Katy Stevens>, <Author: Stephen Keats>]
+ <QuerySet [<Author: Katy Stevens>, <Author: Stephen Keats>]>
``TrigramWordSimilarity``
-------------------------
@@ -375,7 +375,7 @@ Usage example:
... ).filter(
... similarity__gt=0.3
... ).order_by("-similarity")
- [<Author: Katy Stevens>]
+ <QuerySet [<Author: Katy Stevens>]>
``TrigramStrictWordSimilarity``
-------------------------------
@@ -408,7 +408,7 @@ Usage example:
... ).filter(
... distance__lte=0.7
... ).order_by("distance")
- [<Author: Katy Stevens>, <Author: Stephen Keats>]
+ <QuerySet [<Author: Katy Stevens>, <Author: Stephen Keats>]>
``TrigramWordDistance``
-----------------------
@@ -431,7 +431,7 @@ Usage example:
... ).filter(
... distance__lte=0.7
... ).order_by("distance")
- [<Author: Katy Stevens>]
+ <QuerySet [<Author: Katy Stevens>]>
``TrigramStrictWordDistance``
-----------------------------