typesense / laravel-scout-typesense-driver

Laravel Scout Driver for Typesense
https://typesense.org
MIT License
120 stars 37 forks source link

Typesense scout import fails in Laravel 11 #91

Closed pritborteam closed 2 months ago

pritborteam commented 2 months ago

Description

My php artisan scout:import fails for large datasets in Laravel11. This issue is not seen with smaller dataset. May be less than 500.

Steps to reproduce

There is no issue when I was on Laravel 10. When I migrated to Laravel 11.X, this issue is seen. Steps to reproduce:

  1. Create a table with larage data. May be 5000 or 10000.
  2. Do follow the steps of creating toSearchableArray() and Collection as per documentation.
  3. Use "php artisan scout:import "App\Models\YourModel"
  4. You will see error saying record already exist.
  5. On typesense server you will find first batch of initial 500 records already indexed.
  6. So while attempting next batch of index, it is not able to recognise the difference and hence considers documents alre scout-error

Expected Behavior

I should get my documents in batches. Atleast in my case it has been always in a batch of 500 documents.

Actual Behavior

I see only first 500 documents indexed but in next batch index it fails saying collection already exists. In laravel10, this was perfectly fine.

Metadata

Typesense Version: 0.26

OS: Ubuntu 22.04

jasonbosco commented 2 months ago

Duplicate of https://github.com/laravel/scout/issues/822#issuecomment-2062750035

Let's continue the conversation in the other issue.