laravel-blog icon indicating copy to clipboard operation
laravel-blog copied to clipboard

SQLite does not like full text index

Open rabol opened this issue 1 year ago • 0 comments

As SQLite does not like the command to create fultext index, you could do something like this:

 if (DB::connection()->getDriverName() !== 'sqlite') {
            DB::connection(config('laravel-fulltext.db_connection'))->statement('ALTER TABLE laravel_fulltext ADD FULLTEXT fulltext_title(indexed_title)');
            DB::connection(config('laravel-fulltext.db_connection'))->statement('ALTER TABLE laravel_fulltext ADD FULLTEXT fulltext_title_content(indexed_title, indexed_content)');

        }

rabol avatar Oct 28 '24 15:10 rabol