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
PostgreSQL 15.10 (Debian 15.10-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
Description
I have added FTS functionality in my application like so:
Schema::table('table', function (Blueprint $table) {
//$table->fullText(['title'], 'messages_title_fulltext')->language('greek'); // <--- With this I had issues with ignoring greek diacritics...
DB::statement("ALTER TABLE table ADD COLUMN title_fts tsvector GENERATED ALWAYS AS (to_tsvector('greek', coalesce(title,''))) STORED;");
});
Laravel Version
11.44.0
PHP Version
8.3.15
Database Driver & Version
PostgreSQL 15.10 (Debian 15.10-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
Description
I have added FTS functionality in my application like so:
Searching:
When executing the
whereFullText()
, I get an error of:Doing something like this, solves the problem, but opens me up to SQL injection attacks:
And I have also tried this, which didn't work:
Am I doing something wrong, or this is a bug?
UPDATE:
I have found a workaround with this code, but it is possible to avoid using
whereRaw()
altogether, it would be nice to know:Steps To Reproduce
Create a table with a title column and add FTS to it, using the partial migration code given above.
Try to search with the provided code.
The text was updated successfully, but these errors were encountered: