Posts Learn Components Snippets Categories Tags Tools About
/

Speed up Large Laravel Scout Import

Learn how to speed up Large Laravel Scout import by making use of Queue

Created on Jul 25, 2021

738 views

To speed up batch importing large records (millions of rows) into scout search indexes you can make use of queues. Once you have configured a queue driver, set the value of the queue option in your config/scout.php configuration file to true:
# config/scout.php

'queue' => true,

For example, now when you ran "scout:import" command to import the "Post" model, the process will be queued on the background.
php artisan scout:import "App\Models\Post"

But do note that since it's using queue you will need to have the queue running to take care of it. If you are using Laravel Horizon then do run the horizon command.
php artisan horizon

If you like our tutorial, do make sure to support us by being our Patreon or buy us some coffee ☕️

Load comments for Speed up Large Laravel Scout Import

new

PostSrc Code Components

Collection of Tailwind CSS components for everyone to use. Browse all of the components that are right for your project.

View Components

Sponsors 👑

+ Add Yours
)