laravel / scout

Laravel Scout provides a driver based solution to searching your Eloquent models.
https://laravel.com/docs/scout
MIT License
1.54k stars 328 forks source link

Typesense: Import exception not properly thrown #797

Closed saibotk closed 7 months ago

saibotk commented 7 months ago

Scout Version

10.8.1

Scout Driver

Typesense

Laravel Version

10.35.0

PHP Version

8.3.2

Database Driver & Version

Typesense 0.25.2

SDK Version

Typesense PHP 4.9.1

Meilisearch CLI Version

No response

Description

When running artisan scout:import "App\Models\User", the Typesense integration has the following issues:

  1. If the PHP SDK is not installed Scout will not tell you so and still happily runs and says it has imported all the models
  2. After installing the SDK, and not having changed the default config (missing schema definitions), it still goes on and tells you it has successfully imported all models.

This should both not be the case and instead it should break out of trying to import stuff when an exception happens. Internally it gets some "collection not found" exception but it seems that this is supressed or ignored.

Steps To Reproduce

  1. Fresh Laravel + Scout setup
  2. Don't add schema or Typesense SDK to the project
  3. Setup the User model for Scout
  4. Run php artisan scout:import "App\Models\User"
saibotk commented 7 months ago

Nvm turns out after digging into the source that this was just caused by me having enabled the queue option via SCOUT_QUEUE=true.

Sorry!