Troubleshooting | 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/v3)  Basic-usage  Troubleshooting

 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/v3/introduction)
- [ Support us ](https://spatie.be/docs/laravel-site-search/v3/support-us)
- [ Requirements ](https://spatie.be/docs/laravel-site-search/v3/requirements)
- [ Installation and setup ](https://spatie.be/docs/laravel-site-search/v3/installation-setup)
- [ About us ](https://spatie.be/docs/laravel-site-search/v3/about-us)
- [ Questions and issues ](https://spatie.be/docs/laravel-site-search/v3/questions-issues)
- [ Changelog ](https://spatie.be/docs/laravel-site-search/v3/changelog)

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

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

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

- [ Creating multiple search indexes ](https://spatie.be/docs/laravel-site-search/v3/advanced-usage/creating-multiple-search-indexes)
- [ Using a custom indexer ](https://spatie.be/docs/laravel-site-search/v3/advanced-usage/using-a-custom-indexer)
- [ Indexing extra properties ](https://spatie.be/docs/laravel-site-search/v3/advanced-usage/indexing-extra-properties)
- [ Available events ](https://spatie.be/docs/laravel-site-search/v3/advanced-usage/available-events)
- [ Using the database driver ](https://spatie.be/docs/laravel-site-search/v3/advanced-usage/using-the-database-driver)
- [ Using the Meilisearch driver ](https://spatie.be/docs/laravel-site-search/v3/advanced-usage/using-the-meilisearch-driver)
- [ Building a Filament integration ](https://spatie.be/docs/laravel-site-search/v3/advanced-usage/filament-integration)

 Troubleshooting
===============

###  On this page

1. [ Using ArrayDriver for Debugging ](#content-using-arraydriver-for-debugging)

Using ArrayDriver for Debugging
-----------------------------------------------------------------------------------------------------------------------------------------------------

The `ArrayDriver` is a useful debugging tool that uses an in memory array for storing indexed files, while providing comprehensive logging of all operations. This makes it perfect for troubleshooting crawling or indexing issues and understanding what content is being processed.

### Setting up ArrayDriver

To use the ArrayDriver for debugging, update your `config/site-search.php` configuration file:

```
'default_driver' => Spatie\SiteSearch\Drivers\ArrayDriver::class,
```

Or update the `driver_class` property on your `SiteSearchConfig` model.

The ArrayDriver will log all operations to the Laravel log file, allowing you to see exactly what is happening during the crawl and index process.

> \[!WARNING\]
> The ArrayDriver is not suitable for production use as it does not persist data and is intended solely for debugging purposes.

### Running a Synchronous Crawl

To immediately see the indexing process without queuing, use the `--sync` flag. This might be useful to debug efficiently:

```
php artisan site-search:crawl --sync
```

No output will be shown in the console, but you can check the Laravel log file for detailed information about the crawling and indexing process when using the aforementioned `ArrayDriver`.
