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