High level overview | laravel-site-search | Spatie

 SPATIE

  Laravel Site Search
======================

spatie.be/open-source

  [Docs](https://spatie.be/docs)  [Laravel-site-search](https://spatie.be/docs/laravel-site-search/v1)  Basic-usage  High level overview

 Version   v3   v1

 Other versions for crawler [v3](https://spatie.be/docs/laravel-site-search/v3) [v1](https://spatie.be/docs/laravel-site-search/v1)

- [ Introduction ](https://spatie.be/docs/laravel-site-search/v1/introduction)
- [ Support us ](https://spatie.be/docs/laravel-site-search/v1/support-us)
- [ Installation and setup ](https://spatie.be/docs/laravel-site-search/v1/installation-setup)
- [ About us ](https://spatie.be/docs/laravel-site-search/v1/about-us)
- [ Questions and issues ](https://spatie.be/docs/laravel-site-search/v1/questions-issues)
- [ Requirements ](https://spatie.be/docs/laravel-site-search/v1/requirements)
- [ Changelog ](https://spatie.be/docs/laravel-site-search/v1/changelog)

Basic usage
-----------

- [ High level overview ](https://spatie.be/docs/laravel-site-search/v1/basic-usage/high-level-overview)
- [ Indexing your first site ](https://spatie.be/docs/laravel-site-search/v1/basic-usage/indexing-your-first-site)
- [ Retrieving results ](https://spatie.be/docs/laravel-site-search/v1/basic-usage/retrieving-results)
- [ Preventing content from being indexed ](https://spatie.be/docs/laravel-site-search/v1/basic-usage/preventing-content-from-being-indexed)
- [ Using a search profile ](https://spatie.be/docs/laravel-site-search/v1/basic-usage/using-a-search-profile)
- [ Authenticating requests ](https://spatie.be/docs/laravel-site-search/v1/basic-usage/authenticating-requests)
- [ Listing indexes ](https://spatie.be/docs/laravel-site-search/v1/basic-usage/listing-indexes)

Advanced usage
--------------

- [ Creating multiple search indexes ](https://spatie.be/docs/laravel-site-search/v1/advanced-usage/creating-multiple-search-indexes)
- [ Using a custom indexer ](https://spatie.be/docs/laravel-site-search/v1/advanced-usage/using-a-custom-indexer)
- [ Indexing extra properties ](https://spatie.be/docs/laravel-site-search/v1/advanced-usage/indexing-extra-properties)
- [ Customizing Meilisearch settings ](https://spatie.be/docs/laravel-site-search/v1/advanced-usage/customizing-meilisearch-settings)
- [ Available events ](https://spatie.be/docs/laravel-site-search/v1/advanced-usage/available-events)

      You are viewing the documentation for **an older version** of this package. You can check the version you are using with the following command:

 `                                    composer show spatie/laravel-site-search                                                                                                                                                                                                                                    `

High level overview
===================

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 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`](https://spatie.be/docs/laravel-site-search/v1/basic-usage/indexing-your-first-site).

Next, you can fill up a search index by executing [the crawl command](https://spatie.be/docs/laravel-site-search/v1/basic-usage/indexing-your-first-site). Before that commands actually start 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 Meilisearch 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](/docs/laravel-site-search/v1/basic-usage/using-a-search-profile) will determine which pages get crawled and which pages should be put in the Meilisearch index. [An indexer class](/docs/laravel-site-search/v1/advanced-usage/using-a-custom-indexer) 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 Meilisearch index whose name is in `index_name` of `site_search_configs` will be deleted. The `index_name` will now be set to the value of `pending_index_name`.
