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: Using a search profile weight: 5

A search profile determines which pages get crawled and what content gets indexed. In the site-search config file, you'll find in the default_profile key that the Spatie\SiteSearch\Profiles\DefaultSearchProfile::class is being used by default.

This default profile will instruct the indexing process:

  • to crawl each page of your site
  • to only index any page that had 200 as the status code of its response
  • to not index a page if the response had a header site-search-do-not-index

By default, the crawling process will respect the robots.txt of your site.

A search profile is also responsible for determining which indexer will be used for a certain page. An indexer is responsible for determining the title, content, description, ... of a page. By default, Spatie\SiteSearch\Indexers\DefaultIndexer will get used. To know more about indexers and how to customize them, head over to the section on indexers.

Creating your own search profile

If you want to customize the crawling and indexing behavior, you could opt to extend Spatie\SiteSearch\Profiles\DefaultSearchProfile or create your own class that implements the Spatie\SiteSearch\Profiles\SearchProfile interface. This is how that interface looks like.

namespace Spatie\SiteSearch\Profiles;

use Spatie\Crawler\Crawler;
use Spatie\Crawler\CrawlResponse;
use Spatie\SiteSearch\Indexers\Indexer;

interface SearchProfile
{
    public function shouldCrawl(string $url): bool;
    public function shouldIndex(string $url, CrawlResponse $response): bool;
    public function useIndexer(string $url, CrawlResponse $response): ?Indexer;
    public function configureCrawler(Crawler $crawler): void;
}
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