Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Site Search

Laravel Site Search Laravel Package

spatie/laravel-site-search

spatie/laravel-site-search crawls and indexes your entire site to create a private Google-like full-text search. It uses a local SQLite FTS5 database by default with no external dependencies, optional Meilisearch support, and concurrent crawling for speed.

View on GitHub
Deep Wiki
Context7

A site search engine

Frequently asked questions about Laravel Site Search
How do I install and set up spatie/laravel-site-search in a Laravel app?
Install it with Composer, publish the package config, and author a SearchConfig class that describes which URLs to crawl and which text to index. Then run php artisan site-search:crawl to build the index and expose a search route that queries it. Queue workers are effectively mandatory for realistic corpora because the crawl is dispatched as concurrent jobs. The package's own test suite runs with composer test, and a few tests need a local Meilisearch instance on port 7700.
What is spatie/laravel-site-search actually used for?
It is a private, Google-like full-text search engine for your own site: it crawls your pages over HTTP and builds a searchable index from the rendered content. The sweet spot is server-rendered marketing sites, documentation, blogs, and CMS-driven pages inside a Laravel monolith. It is not a content-pipeline hook, so content that only exists behind JavaScript rendering or authentication is out of scope.
Does spatie/laravel-site-search require Meilisearch or another external service?
No. By default it stores the index in a local SQLite database using FTS5, so there is no Algolia, Typesense, or Elasticsearch procurement and no extra ops burden. Meilisearch is an optional driver you can enable if you need richer relevance or typo tolerance. Version 3 also added a MySQL driver, which co-locates the full-text index with your primary database.
Which Laravel and PHP versions does spatie/laravel-site-search support?
The 3.x line requires PHP 8.3 or higher and supports Laravel 11, 12, and 13; Laravel 10 support was dropped. The project bumps minimum PHP and Laravel versions aggressively, and both 2.0 and 3.0 were breaking releases. Plan on an upgrade project roughly once a year rather than a set-and-forget dependency.
How do I control which pages and text get crawled and indexed?
You define this in a SearchConfig class: which URL patterns to include or exclude, and which parts of the HTML are treated as indexable text. Everything is derived data, so you can drop and rebuild the index from the live site at any time. Exclusions matter for security too, because the package does not enforce who may see a result, so any non-public page reachable by the crawler becomes discoverable unless you filter it at the config layer.
How do I show search results in my Laravel application?
You add your own route and controller that queries the index and renders titles, snippets, and URLs in a view. The package handles crawling, indexing, and searching, but access control, result presentation, and UX are your responsibility. A competent Laravel pair can have a staging demo working in about a day: install, publish config, write the SearchConfig, crawl, expose the route.
Should I use the SQLite, MySQL, or Meilisearch driver?
This is a genuine architectural fork, so decide it from deployment topology and relevance requirements instead of deferring it. If you run multiple app nodes, the SQLite index file must live on shared or persistent storage, otherwise SQLite is disqualified from day one. If you need typo tolerance, synonyms, faceting, or multilingual relevance, go straight to Meilisearch rather than expecting FTS5 to feel like Google.
Is spatie/laravel-site-search safe to run in production?
Yes, with hardening: crawling your own production origin generates real traffic, follows links unpredictably, and can loop on parameterized URLs. Recent patch releases are evidence of real incidents, including query-string stripping in 3.0.2 and an Isolatable crawl command in 3.0.1 to stop overlapping runs and duplicate documents. Run full crawls inside an off-peak window, schedule them, and decide up front who gets paged if a crawl silently stops succeeding.
What are the limitations of crawling your own site for search?
It is an HTTP crawler, so JavaScript-rendered SPAs, authenticated content, and pages that are not linked from anywhere will not be indexed unless you handle them explicitly. FTS5 gives exact-token matching with limited ranking control, no typo tolerance, and weak relevance tuning. Treat user search strings as untrusted input: 3.0.3 fixed MySQL boolean-mode operators such as @, +, and - causing syntax errors on ordinary queries like icu4c@78.
Are there alternatives to spatie/laravel-site-search, and is it well maintained?
Alternatives are Laravel Scout backed by Algolia, Meilisearch, Typesense, or Elasticsearch, all of which require a separate search service but offer stronger relevance features. This package is maintained by Spatie under the MIT license and gets regular releases, but it has modest adoption (roughly 309 stars and no dependents), so you would be an early adopter relying on the maintainer's reputation rather than field evidence. If upstream stalls, the MIT license permits forking, so identify who on your team would own that.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections