From efb96138b4af774c22ae6e949410b45d69960357 Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Tue, 23 Sep 2025 07:14:31 -0400 Subject: [PATCH] Refs #25508 -- Used QuerySet.__repr__ in docs/ref/contrib/postgres/search.txt. --- docs/ref/contrib/postgres/search.txt | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/ref/contrib/postgres/search.txt b/docs/ref/contrib/postgres/search.txt index 88e3cfaeb0..0d14bc8c05 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") - [, ] + , ]> 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") - [, ] + , ]> 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") - [, ] + , ]> See :ref:`postgresql-fts-search-configuration` and :ref:`postgresql-fts-weighting-queries` for an explanation of the ``config`` @@ -142,7 +142,7 @@ order by relevancy: >>> vector = SearchVector("body_text") >>> query = SearchQuery("cheese") >>> Entry.objects.annotate(rank=SearchRank(vector, query)).order_by("-rank") - [, ] + , ]> See :ref:`postgresql-fts-weighting-queries` for an explanation of the ``weights`` parameter. @@ -240,7 +240,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")) - [] + ]> The value of ``config`` could also be stored in another column: @@ -250,7 +250,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"))) - [] + ]> .. _postgresql-fts-weighting-queries: @@ -364,7 +364,7 @@ if it were an annotated ``SearchVector``: >>> Entry.objects.update(search_vector=SearchVector("body_text")) >>> Entry.objects.filter(search_vector="cheese") - [, ] + , ]> .. _PostgreSQL documentation: https://www.postgresql.org/docs/current/textsearch-features.html#TEXTSEARCH-UPDATE-TRIGGERS @@ -403,7 +403,7 @@ Usage example: ... ).filter( ... similarity__gt=0.3 ... ).order_by("-similarity") - [, ] + , ]> ``TrigramWordSimilarity`` ------------------------- @@ -426,7 +426,7 @@ Usage example: ... ).filter( ... similarity__gt=0.3 ... ).order_by("-similarity") - [] + ]> ``TrigramStrictWordSimilarity`` ------------------------------- @@ -459,7 +459,7 @@ Usage example: ... ).filter( ... distance__lte=0.7 ... ).order_by("distance") - [, ] + , ]> ``TrigramWordDistance`` ----------------------- @@ -482,7 +482,7 @@ Usage example: ... ).filter( ... distance__lte=0.7 ... ).order_by("distance") - [] + ]> ``TrigramStrictWordDistance`` -----------------------------