This demo is created to showcase the full-text search feature in SQLite using the FTS4 module. Learn more about FTS in this blog.
This demo uses Laravel + Volt.
Use the following steps to setup the demo in your local environment.
Clone the repository using the following command -
git clone https://github.com/frikishaan/laravel-sqlite-fts-demoInstall the PHP and Node dependencies using -
composer installnpm install && npm run buildIn this demo I have used the Hackernews dataset, which can be found here. It has more than 290K records, which is also nice to stress test the functionality.
Put the downloaded csv in the storage/app/public folder of your project.
Run the laravel migrations -
php artisan migrateUse the load-db command found in this project to populate the database from the csv content.
Before running the command make sure the $csv_path variable in this file is set to the path where your csv is located.
php artisan load-dbRun the laravel in-built server using
php artisan serveNavigate to the /search route.
You should see the search results as seen below -
