Posts Learn Components 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

56 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

Snippets 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.

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's right for your project.

View Components

Other Code Snippets

More