Weave Code
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 Package

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.

View on GitHub
Deep Wiki
Context7

title: Indexing your first site weight: 2

On this page, you'll learn how to create an index, populate it by crawling your site, and retrieving results. Let's do this!

First, you can run this command to define a site that needs to be indexed.

php artisan site-search:create-index

This command will ask for a name for your index, and the URL of your site that should be crawled.

After that you should run this command to start a queued job that crawls your site, and puts the content in a search index:

php artisan site-search:crawl

Finally, you can use the Search class to perform a query on your index.

use Spatie\SiteSearch\Search;

$searchResults = Search::onIndex($indexName)
    ->query('your query')
    ->get();

This is how you could render the results in a Blade view

<ul>
    [@foreach](https://github.com/foreach)($searchResults->hits as $hit)
        <li>
            <a href="{{ $hit->url }}">
                <div>{{ $hit->url }}</div>
                <div>{{ $hit->title() }}</div>
                <div>{!! $hit->highlightedSnippet() !!}</div>
            </a>
        </li>
    [@endforeach](https://github.com/endforeach)
</ul>
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.
codraw/entity-migrator
codraw/doctrine-extra
codraw/aws-tool-kit
codraw/validator
codraw/workflow
codraw/open-api
codraw/cron-job
codraw/process
codraw/log
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony