Skip to content

Latest commit

 

History

History
66 lines (40 loc) · 1.63 KB

File metadata and controls

66 lines (40 loc) · 1.63 KB

SQLite Full-text search demo

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.

Setup

Use the following steps to setup the demo in your local environment.

Clone the repository

Clone the repository using the following command -

git clone https://github.com/frikishaan/laravel-sqlite-fts-demo

Install dependencies

Install the PHP and Node dependencies using -

composer install
npm install && npm run build

Download data

In 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 migrations

Run the laravel migrations -

php artisan migrate

Populate the data in database

Use 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-db

Playaround

Run the laravel in-built server using

php artisan serve

Navigate to the /search route.

You should see the search results as seen below -

SQLite FTS demo using laravel