diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-05-18 16:06:29 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-05-22 15:25:58 -0400 |
commit | 719197dd9399b4436aeaba3e2f44761292036ad6 (patch) | |
tree | e96ab9de424d9faa5add9105260fd5471cdf6fa6 /lib/sqlalchemy/sql/operators.py | |
parent | 0620614f95f62f35396e63c636cae98a0759f3ab (diff) | |
download | sqlalchemy-719197dd9399b4436aeaba3e2f44761292036ad6.tar.gz |
use plainto_tsquery for PG match
The :meth:`.Operators.match` operator now uses ``plainto_tsquery()`` for
PostgreSQL full text search, rather than ``to_tsquery()``. The rationale
for this change is to provide better cross-compatibility with match on
other database backends. Full support for all PostgreSQL full text
functions remains available through the use of :data:`.func` in
conjunction with :meth:`.Operators.bool_op` (an improved version of
:meth:`.Operators.op` for boolean operators).
Additional doc updates here apply to 1.4 so will backport these
out to a separate commit.
Fixes: #7086
Change-Id: I1946075daf5d9c558e85f73f1bf852604b3b1b8c
Diffstat (limited to 'lib/sqlalchemy/sql/operators.py')
-rw-r--r-- | lib/sqlalchemy/sql/operators.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/operators.py b/lib/sqlalchemy/sql/operators.py index 0a8527761..593454432 100644 --- a/lib/sqlalchemy/sql/operators.py +++ b/lib/sqlalchemy/sql/operators.py @@ -1129,7 +1129,13 @@ class ColumnOperators(Operators): a MATCH-like function or operator provided by the backend. Examples include: - * PostgreSQL - renders ``x @@ to_tsquery(y)`` + * PostgreSQL - renders ``x @@ plainto_tsquery(y)`` + + .. versionchanged:: 2.0 ``plainto_tsquery()`` is used instead + of ``to_tsquery()`` for PostgreSQL now; for compatibility with + other forms, see :ref:`postgresql_match`. + + * MySQL - renders ``MATCH (x) AGAINST (y IN BOOLEAN MODE)`` .. seealso:: |