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.
This package will crawl your entire site and will put the content in a search index. This way, the entire content of your site is searchable. Think of it as a private Google search index.
The package supports two search drivers: Database (default, supporting SQLite, MySQL, and PostgreSQL) and Meilisearch. The search and indexing API is the same regardless of which driver you use.
The configuration for each site that needs to be crawled is saved in the site_search_configs table. You can manually create a row in that table or run this artisan command: site-search:create-index.
Next, you can fill up a search index by executing the crawl command. Before that command actually starts crawling, it will clean up old indexes whose names start with the index_base_name specified in the site_search_configs table. After that, it will create a new empty index. The name of that new index will be saved in the pending_index_name column of the site_search_configs table.
A search profile class will determine which pages get crawled and which pages should be put in the search index. An indexer class will transform the HTML of a page to something that can be saved in the index.
When crawling your site, multiple concurrent connections are used to speed up the crawling process.
After the site has been crawled, the old index will be deleted and replaced by the newly built one.
How can I help you explore Laravel packages today?