Troubleshooting | laravel-site-search-go | Spatie       

 SPATIE  

laravel-site-search-go
======================

spatie.be/open-source

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

 Version   v1      

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

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

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

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

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

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

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

###  On this page 

1. [ Using ArrayDriver for debugging ](#content-using-arraydriver-for-debugging)
2. [ Running a synchronous crawl ](#content-running-a-synchronous-crawl)
3. [ Empty results ](#content-empty-results)
4. [ Failed replacements ](#content-failed-replacements)

Using ArrayDriver for debugging
-----------------------------------------------------------------------------------------------------------------------------------------------------

The array driver keeps documents in memory. Use it to inspect indexing without a search service:

```
sitesearch.New(func(cfg *sitesearch.Config) {
    cfg.DefaultDriver = "array"
})
```

Or set a saved configuration's `Driver` field to `array`. Indexes belong to the application instance and disappear when its process exits. Unlike the PHP debugging driver, the Go array driver does not log every operation. Listen for [indexing events](../advanced-usage/available-events) to collect diagnostics.

The array driver is not suitable for persistent production indexes. In particular, a separate worker's in-memory index is not visible to your web process.

Running a synchronous crawl
-----------------------------------------------------------------------------------------------------------------------------------------

To run indexing without a queue worker:

```
laravel site-search:crawl --sync
```

The command returns an error if dispatch or indexing fails. Use `site-search:list` to inspect the latest crawl status.

Empty results
-----------------------------------------------------------------------------------------------

Check that the configuration has a nonempty `IndexName`, the crawl URL is reachable, `robots.txt` permits crawling, and your profile or headers are not excluding content. JavaScript-only content is not present in the HTML response and is not indexed by default.

Search tokenization differs between drivers. Database full-text search is not a substring search. An empty query returns `ErrNoQuery`, while no matching documents returns an empty `Hits` slice.

Failed replacements
-----------------------------------------------------------------------------------------------------------------

The old active index remains searchable when a crawl fails before promotion. Fix the reported error and retry. Use a shared cache store across workers to enforce per-configuration locks. The default timeout is five minutes, configurable through `CrawlTimeout`.

If promotion succeeded but deleting the old index failed, the new index stays active. A later crawl cleans up orphan generations. Database failures can also leave pending status behind, so investigate the returned persistence error rather than manually changing index names.

 A good
match?
-------------

### What we do best

- All things Laravel
- Custom frontend components
- Building APIs
- AI-powered features
- Simplifying things
- Clean solutions
- Integrating services

### Not our cup of tea

- WordPress themes
- Cutting corners
- Free mockups to win a job
- "Just execute the briefing"

 In short: we'd like to be a **substantial part** of your project.

 [ Get in touch via email ](mailto:info@spatie.be?subject=A%20good%20match%21&body=Tell%20us%20as%20much%20as%20you%20can%20about%0A-%20your%20online%20project%0A-%20your%20planning%0A-%20your%20budget%0A-%20%E2%80%A6%0A%0AAnything%20that%20helps%20us%20to%20start%20straightforward%21)
