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 extra properties weight: 3

By default, only the page title, URL, description, and some content are added to the search index. However, you can add any extra property you want.

You do this by using a custom indexer and override the extra method.

class YourIndexer extends Spatie\SiteSearch\Indexers\DefaultIndexer
{
    public function extra() : array{
        return [
            'authorName' => $this->functionThatExtractsAuthorName()
        ]    
    }
    
    public function functionThatExtractsAuthorName()
    {
        // add logic here to extract the username using
        // the `$response` property that's set on this class
    }
}

The extra properties will be available on a search result hit.

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

$firstHit = $searchResults->hits->first();

$firstHit->authorName; // returns the author name

All extra properties are searchable by default. When using the Meilisearch driver, you can customize the index settings to control which attributes are searchable.

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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport