[Solved] Php artisan scout:import says all ok but doesn't import data into algolia server

I have a similar issue like Actually nothing is imported to algolia.

When I do php artisan scout:import on staging server, it says

[OK] All [App\Models\ModelName] records have been flushed.
Imported [App\Models\ModelName] models up to ID: App\Models\Business::9
 [OK] All [App\Models\ModelName] records have been imported.

But nothing gets pushed to algolia server. When I check the Search API Logs I see /1/indexes/model_name/clear. No batch request here.

I have set scout queue false, scout driver to algolia, correct app id and api keys, still doesn’t push data to the server.

If I do the same thing on my local machine, the data gets pushed to algolia. The related configs are same for local and staging server.

What could I have done wrong?

There was a condition like is_active flag, if which is false return ; that was causing the issue.