Posts Learn Snippets Categories Tags 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

7 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

Created by

PostSrc poster

PostSrc

Full stack developer mainly focusing on the front end side of the web. The main author of PostSrc and loves writing tutorial and guides online.