laravel / scout

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

Algolia Search PHP Client v4 is not Compatible #855

Open Gautamsam3 opened 2 months ago

Gautamsam3 commented 2 months ago

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>"
driesvints commented 2 months ago

Thanks. Welcoming PR's to make sure we're compatible with v4 👍

alexander-schranz commented 2 months ago

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.

driesvints commented 2 months ago

We can cut a new major release if need be.

karandatwani92 commented 2 months ago

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.

muhghazaliakbar commented 1 month ago

Is there any update on this?

github-actions[bot] commented 3 weeks ago

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!