Download the PHP package ktr/laravel-lightsearch-driver without Composer
On this page you can find all versions of the php package ktr/laravel-lightsearch-driver. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ktr/laravel-lightsearch-driver
More information about ktr/laravel-lightsearch-driver
Files in ktr/laravel-lightsearch-driver
Package laravel-lightsearch-driver
Short Description A Laravel Scout driver for LightSearch using a shared database index
License MIT
Informations about the package laravel-lightsearch-driver
Laravel LightSearch
A Laravel Scout driver using a shared DB table for inverted index. It utilizes a unigram model for tokenization, breaking text into individual words to build an efficient and searchable index. Works with your existing database (MySQL, Postgres, SQLite).
Installation
Usage
Add Searchable
to models, import via:
Search:
Available Options
- Customize the importance ('weight') of specific fields for each model.
- The key is your model class (e.g., ).
\App\Models\Model::class
- The value is an array of field names with their search relevance weight (1–5).
- Default weight is 1 if not specified.
model_field_weights
This allows you to make some model fields more influential in search results. For example, giving the city
field a weight of 2
makes matches on the city field twice as significant as those with the default weight.
Example Configuration in config/scout.php
Enabling the Driver
Set the driver in your file: .env
All versions of laravel-lightsearch-driver with dependencies
laravel/scout Version ^9.0 || ^10.0
illuminate/support Version ^10.0 || ^11.0 || ^12.0
illuminate/database Version ^10.0 || ^11.0 || ^12.0