laravel/scout

Algolia Search PHP Client v4 is not Compatible

Gautamsam3 opened this issue ยท 11 comments

Scout Version

10.11.1

Scout Driver

Algolia

Laravel Version

11

PHP Version

8.3.8

Database Driver & Version

No response

SDK Version

No response

Meilisearch CLI Version

No response

Description

As per Laravel's documentation, user needs to install Alogila client via following command:

composer require algolia/algoliasearch-client-php`

This by default installs latest version v4 of the Algolia Search client, which was recently released.

algolia_v41

Issue:

Despite the successful installation, php artisan scout:import "App\Models\Variant" command results an error.

algolia_v4

Steps To Reproduce

  1. Install algolia/algoliasearch-client-php in the project.
  2. Configure model.
  3. Import php artisan scout:import "App\Models\<model name>"

Thanks. Welcoming PR's to make sure we're compatible with v4 ๐Ÿ‘

If somebody require some references I did work on v3 -> v4 update in my own package. https://github.com/schranz-search/schranz-search/pull/414/files.

Linking also the Upgrade Guide from Algolia: https://www.algolia.com/doc/libraries/php/v4/upgrade/

The hard part is mostly if you want to keep V3 support then I think its lot of more work, else you can only do it for next major.

We can cut a new major release if need be.

Thanks @alexander-schranz

Your links helped a lot. I think the scout repo doesn't need many changes. I have made a few changes locally. Things worked fine for now. I'll be testing a little more tomorrow before submitting the PR

I hope everything goes well. I'm very excited to submit my first PR on Laravel's repo.

Is there any update on this?

Thank you for reporting this issue!

As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.

If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.

Thank you!

We can cut a new major release if need be.

Yes this should/could have been a major release as it does break algolia/scout-extended dependencies

algolia/scout-extended#347

I've submitted PR algolia/scout-extended#348 to downgrade Laravel Scout to v10.11.5.

While we await approval and merge, you can run this Composer command in your project(s):

composer update laravel/scout v10.11.5

Thank you for reporting this issue!

As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.

If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.

Thank you!

Is there any update on this?

Hey ThumbTech,

You can to downgrade Laravel Scout to v10.11.5 by running this Composer command in your project(s):

composer update laravel/scout v10.11.5

composer update laravel/scout v10.11.5

composer require laravel/scout v10.11.5 actually does work

(Better IMO to leave scout-extended as is and just commit to v11 on scout, as numerous others have recommended.)