Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scout:reimport not creating all indexes #318

Open
tao opened this issue Jan 11, 2023 · 0 comments
Open

scout:reimport not creating all indexes #318

tao opened this issue Jan 11, 2023 · 0 comments

Comments

@tao
Copy link

tao commented Jan 11, 2023

  • Laravel version: v9.47.0
  • Algolia Scout Extended version: v2.1.0

Description

This bug* causes an issue on Laravel Nova, as using scout:reimport does not create all the indexes, which means the global search on Nova stops working. When you use scout:import is works correctly.

Steps To Reproduce

If I run an import it produces this in the terminal:

$ php artisan scout:import  

 [OK] All [App\Search\Combined] records have been flushed.                                            
Imported [App\Search\Combined] models up to ID: App\Models\Ingredient::1
 [OK] All [App\Search\Combined] records have been imported.                                           
 [OK] All [App\Models\Ingredient] records have been flushed.                                          
Imported [App\Models\Ingredient] models up to ID: App\Models\Ingredient::1
 [OK] All [App\Models\Ingredient] records have been imported.                                         
 [OK] All [App\Models\Medicine] records have been flushed.                                            
Imported [App\Models\Medicine] models up to ID: App\Models\Medicine::1
 [OK] All [App\Models\Medicine] records have been imported.                                           
 [OK] All [App\Models\Cosmetic] records have been flushed.                                            
Imported [App\Models\Cosmetic] models up to ID: App\Models\Cosmetic::4
 [OK] All [App\Models\Cosmetic] records have been imported.                                           
 [OK] All [App\Models\Organization] records have been flushed.                                        
Imported [App\Models\Organization] models up to ID: App\Models\Organization::1
 [OK] All [App\Models\Organization] records have been imported.                                       

On the Algolia dashboard it shows the indexes exist:

Screenshot 2023-01-11 at 22 55 19

And I can search for them on Nova:
Screenshot 2023-01-11 at 22 55 50

When I run scout:reimport though something else happens...

 🔎 Importing: [App\Search\Combined,App\Models\Ingredient,App\Models\Medicine,App\Models\Cosmetic,App\Models\Organization]

  0/15 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░]   0% Creating temporary index temp_combined
  2/15 [▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░]  13% Importing records to index temp_combined
  3/15 [▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░]  20% Replacing index combined by index temp_combined
 Creating temporary index temp_ingredients
  5/15 [▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░]  33% Importing records to index temp_ingredients
  6/15 [▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░]  40% Replacing index ingredients by index temp_ingredients
 Creating temporary index temp_medicines
  8/15 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░]  53% Importing records to index temp_medicines
 Replacing index medicines by index temp_medicines
 Creating temporary index temp_cosmetics
 11/15 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░]  73% Importing records to index temp_cosmetics
 Replacing index cosmetics by index temp_cosmetics
 Creating temporary index temp_organizations
 14/15 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░]  93% Importing records to index temp_organizations
 15/15 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100% Replacing index organizations by index temp_organizations

 [OK] All                                                                                             
      [App\Search\Combined,App\Models\Ingredient,App\Models\Medicine,App\Models\Cosmetic,App\Models\Or
      ganization] records have been imported                                                          

But when I look at the dashboard not all the indexes exist anymore:

Screenshot 2023-01-11 at 22 57 25

So when I search in Nova again, it finds nothing because it tries to look in the Ingredients index and it's not there:

Screenshot 2023-01-11 at 22 58 07

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant