spatie/laravel-site-search
Crawl and index your Laravel site for fast full-text search—like a private Google. Highly customizable crawling and indexing, with concurrent requests. Uses SQLite FTS5 by default (no external services), or Meilisearch for advanced features.
The database driver is the default driver. It stores search documents in your application's database and uses the database's native full-text search capabilities. SQLite (FTS5), MySQL (FULLTEXT), and PostgreSQL (tsvector) are all supported.
The database driver stores all indexed documents in a single site_search_documents table. Each document is associated with an index_name, which allows multiple search indexes to coexist in the same table.
Full-text search infrastructure (virtual tables, indexes, triggers) is created automatically at runtime based on which database you are using. The migration itself is database-agnostic.
SQLite uses FTS5 virtual tables with porter stemming and unicode support. BM25 ranking weights matches in headings higher than body content. Highlighted snippets are generated natively by FTS5.
MySQL uses FULLTEXT indexes with boolean mode search. Highlighting is done in PHP after the query.
PostgreSQL uses tsvector columns with GIN indexes and weighted vectors. ts_rank() is used for ranking and ts_headline() for highlighting.
All three databases provide:
<em> tagsBy default, the database driver uses your application's default database connection. You can use a different connection by setting a database.connection value in the extra attribute of the site_search_configs table:
{"database": {"connection": "mysql"}}
This lets you store search data in a separate database from your application data.
How can I help you explore Laravel packages today?