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


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