You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Feature Request: Add mode = none to whereFullText() for raw to_tsquery for Postgres
Hi! 👋
I’d like to propose adding support for a “none” mode to the full-text query grammar so that whereFullText() can optionally use raw to_tsquery instead of plainto_tsquery, phraseto_tsquery, or websearch_to_tsquery.
Why this is needed
PostgreSQL’s prefix search (:*) is not recognized by:
plainto_tsquery
phraseto_tsquery
websearch_to_tsquery
These functions all treat characters like : and * as literal text, not operators.
This means you cannot perform a prefix search like:
to_tsquery('english', 'Ent:*')
when using the current whereFullText() implementation.
Prefix searching is a very common use case (autocomplete, partial-name search, etc.), and the only way to get it is via the raw to_tsquery function.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Feature Request: Add
mode = nonetowhereFullText()for rawto_tsqueryfor PostgresHi! 👋
I’d like to propose adding support for a “none” mode to the full-text query grammar so that
whereFullText()can optionally use rawto_tsqueryinstead ofplainto_tsquery,phraseto_tsquery, orwebsearch_to_tsquery.Why this is needed
PostgreSQL’s prefix search (
:*) is not recognized by:plainto_tsqueryphraseto_tsquerywebsearch_to_tsqueryThese functions all treat characters like
:and*as literal text, not operators.This means you cannot perform a prefix search like:
when using the current
whereFullText()implementation.Prefix searching is a very common use case (autocomplete, partial-name search, etc.), and the only way to get it is via the raw
to_tsqueryfunction.Proposed Enhancement
allow:
to select:
Example Usage
Which would compile to:
This gives developers a clean and safe way to use native tsquery syntax—especially prefix operators—without manually writing raw SQL.
PR
#57915
Similar changes elsewhere
tpetry/laravel-postgresql-enhanced#121
Beta Was this translation helpful? Give feedback.
All reactions