Download the PHP package mtk3d/scout-sqlite-fts5 without Composer

On this page you can find all versions of the php package mtk3d/scout-sqlite-fts5. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package scout-sqlite-fts5

Laravel Scout SQLite FTS5 Driver

Tests Documentation PHP Latest version

Full-text search for your Eloquent models, powered by SQLite's own FTS5 engine. A Laravel Scout driver that keeps the search index right next to your data.

No daemon, no API key, no second datastore to keep in sync. composer require, one artisan command, and Model::search() works.

That query finds Jan Kowalski despite the typo, because search runs as a cascade of progressively fuzzier passes and stops at the first one that matches. Results come back ranked by BM25, ordered and paginated in SQL.

Why this driver

Scout's built-in database driver searches your model's own columns — with LIKE, or through a full-text index you create yourself.

Dedicated search engines — Meilisearch, Typesense, Algolia — mean running a service alongside your app. For a desktop app, a NativePHP build, a single-tenant SaaS, or a CLI tool, that is a lot of moving parts for a search box.

SQLite already ships a real inverted index. This package points Scout at it.

Not on SQLite? namoshek/laravel-scout-database is a Scout driver that builds its own inverted index in ordinary tables, and runs on every database Laravel supports.

Status

This is version 0, and it is the first implementation. The search was built for a NativePHP application and shaped by what that application needed, which is the case it is known to serve well — not evidence that it is the right shape for every application.

Development continues, and the way documents are written and stored is the part most likely to change — but not inside version 0. Every 0.x release keeps the index format the one before it had, so upgrading within 0 is an ordinary composer update. A change of format waits for version 1, which may index different things, store them differently, or lay the tables out another way entirely. When it comes, adopting it is a scout:fts5-rebuild rather than a migration you have to write, because the index is derived from your models.

Requirements

Check yours:

Installation

Point Scout at the driver in .env:

Then create the index tables and fill them:

scout:fts5-create finds every model in app/Models that uses Laravel\Scout\Searchable and gives each one a virtual table named after searchableAs() — customers becomes customers_fts. There is no migration to publish and nothing to commit: the tables are derived from your models, and scout:fts5-rebuild recreates them from scratch whenever you need.

Publishing the config is optional:

Usage

Everything is plain Scout. Make a model searchable and search it:

Sorting, filtering and pagination all happen in SQL before results are sliced into pages, so page 2 really is the second page of the order you asked for.

How search works

A query is answered by four passes, tried strictest first. The first pass that matches anything wins, and the rest never run — so an exact query costs exactly one indexed MATCH, and only a query that finds nothing pays for the fuzzy interpretations.

Pass For the query jan kowalsky Catches
prefix "jan"* AND "kowalsky"* exact and partial words
typo "jan"* AND "kowals"* a wrong word ending
any "jan"* OR "kowalsky"* one word of several being wrong
trigram content LIKE '%owa%' … a typo in the middle of a word

You can ask which pass answered, which is handy for telling a user you guessed:

Read more about the cascade and how it is ranked →

Filtering

Filters on columns you declare are answered by the index itself:

Filters on columns you did not declare still work — the driver joins the model's own table, which is in the same SQLite file. Nothing is silently ignored, and a filter on a column that exists nowhere throws rather than quietly returning wrong results.

Read more about filtering, ordering and soft deletes →

Commands

Command What it does
scout:fts5-create Creates missing index tables. --fresh drops and recreates them.
scout:fts5-rebuild Drops, recreates and reimports. Use after changing filters or the tokenizer.
scout:fts5-drop Drops index tables.
scout:fts5-optimize Merges index segments. Worth running after a bulk import.

All of them take model class names, and discover models from scout-fts5.model_paths when given none. Scout's own scout:import, scout:flush and scout:index work as usual.

Configuration

The defaults are meant to be usable as they are. The knobs worth knowing about:

Turning off any keeps multi-word queries strict; turning off trigram means search never scans. Changing the tokenizer changes the index, so rebuild after touching it.

Full configuration reference →

Documentation

The full documentation is published at mtk3d.github.io/scout-sqlite-fts5, built with mdBook from the same pages that live in docs/ in this repository.

Things to know

Testing

Credits

Extracted from the search implementation in Wrenchr, a workshop management app, where it replaced a Scout driver that scanned.

License

MIT. See LICENSE.md.


All versions of scout-sqlite-fts5 with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
ext-pdo Version *
illuminate/console Version ^12.0|^13.0
illuminate/database Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
laravel/scout Version ^11.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mtk3d/scout-sqlite-fts5 contains the following files

Loading the files please wait ...