Subject: issue in the doc

From: Yousef Mohamed <[email-masked]>
Date: Mon, 6 Apr 2026 00:38:17 +0200

Page:
https://www.postgresql.org/docs/current/textsearch-intro.html

The documentation says:

tsvector @@ tsquery
tsquery  @@ tsvector
text @@ tsquery
text @@ text

The first two of these we saw already. The form text @@ tsquery is
equivalent to to_tsvector(x) @@ y. The form text @@ text is equivalent
to to_tsvector(x)
@@ plainto_tsquery(y).

Question:

In the expression:
to_tsvector(x) @@ plainto_tsquery(y)

what do x and y refer to exactly?

are they correspond to the left-hand and right-hand sides of the original
expression (text @@ text) ?

if yes , i think it's better to mention the order of the x and y like :
(x @@ y ) or ( y @@ x)

thanks

---

From: "David G. Johnston" <[email-masked]>
Date: Sun, 5 Apr 2026 16:00:03 -0700

> what do x and y refer to exactly?
Local variables for the single expression being described.  x is a text
typed value capable of being parsed as a vector, y is a text typed value
capable of being parsed as a query.  (Or unknown, which then defaults to
text.).

> expression (text @@ text) ?
In that x comes before y in the English alphabet just like in that
left-to-right language left comes physically before right, yes.

(text @@ text) isn’t an expression, it’s one’s way of writing the name of a
type.

> (x @@ y ) or ( y @@ x)
I’m not following how you think this could be improved.  I get it’s very
western-centric, and admit it took me a moment to understand, but once I
did it seems quite clear to me.  A concrete change to consider would be
helpful if this still doesn’t make sense.  I have a few thoughts of my own,
chief among them being using real examples, but it doesn’t really my
threshold to work on at this time.

David J.