laravel / scout

Laravel Scout provides a driver based solution to searching your Eloquent models.
https://laravel.com/docs/scout
MIT License
1.54k stars 328 forks source link

Laravel Scout Meilisearch: Says Imported Models, but doesn't #536

Closed PR4M closed 2 years ago

PR4M commented 2 years ago

Description:

Running `php artisan scout:import "App\Models\:name" always returns: All [App\Models\Content] records have been imported.

But the model records were never stored on Meilisearch. Neither the index was automatically created during the import process (as I saw on Youtube, running the scout import command seems auto-creating the Meilisearch index if it does not exist.

I had to run php artisan scout:index contents to create the contents index on Meilisearch.

Note: All the configuration of Meilisearch on the server is done correctly, the meilisearch_key is also already in place. scout_queue is already set to false or at the moment, no queue driver is used and running.

Steps To Reproduce:

Run the following artisan commands (had no effect)

php artisan cache:clear php artisan route:clear php artisan config:cache composer dumpautoload

I also notice that on other people, the scout:import always returns with numbers of records that have been imported such as:

But in my case, it's only: All [App\Models\Content] records have been imported.

Thank you.

driesvints commented 2 years ago

Please provide the exact Scout and Meilisearch versions when submitting issues.

Did you:

PR4M commented 2 years ago

Here's the exact Meilisearch version:

{
    "commitSha": "928930ddd552596f51280a17c143cf38079cdea9",
    "commitDate": "2021-09-13T10:17:10+00:00",
    "pkgVersion": "0.22.0"
}

Here's the exact Scout version: v9.2.10

driesvints commented 2 years ago

Heya, thanks for reporting.

We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as separate commits on the main/master branch and share the repository here? Please make sure that you have the latest version of the Laravel installer in order to run this command. Please also make sure you have both Git & the GitHub CLI tool properly set up.

laravel new bug-report --github="--public"

Please do not amend and create a separate commit with your custom changes. After you've posted the repository, we'll try to reproduce the issue.

Thanks!

driesvints commented 2 years ago

Closing this issue because it's inactive, already solved, old or not relevant anymore. Feel to open up a new issue if you're still experiencing this.

ianbrucey commented 2 years ago

Also having the same issue. I keep running scout import, but no data is being pushed. Has there been any updates on this issue?

curquiza commented 2 years ago

This might not be related to Laravel, check your task status using this route in MeiliSearch. You will know if the import failed or is still processing. https://docs.meilisearch.com/reference/api/updates.html#get-all-update-status

michaelklopf commented 2 years ago

We have similar issues, the problem is that scout says all is good, but not even tasks are created in meilisearch. Doing it with curl on the machine does create entries in the index.

XZzYassin commented 1 year ago

are you guys using any queues? because I think Laravel\Scout\Jobs\MakeSearchable jobs are being pushed to the queue but are not being consumed by any worker.

mrpritchett commented 1 year ago

Did anyone figure this out? Having what seems like the same issue as above. No MakeSearchable jobs are being picked up.

klipitkas commented 1 year ago

This is still an issue using Meilisearch 1.1.1 and Laravel Scout v10.1.1

mmachatschek commented 1 year ago

@klipitkas this most likely is a combination of unknowingly using the laravel task queue for laravel scout and not running any worker or meilisearchs task queue not done with the tasks being sent https://www.meilisearch.com/docs/learn/advanced/asynchronous_operations .

kamasuPaul commented 5 months ago

If you're here searching for a solution because when you batch import using something like php artisan scout:import "App\Models\Post" and meilsearch is not showing the imported data, it's probably because you're not running a queue. The batch import uses a queue. So running php artisan queue:listen might help you.

erycson commented 5 months ago

I'm only recently having this problem, in my case I discovered that the MakeSearchable Job is always receiving empty $models, so nothing is processed/sent to Meilisearch.

And yes, I'm sure the queue is being executed

I'm using:

PHP laravel/framework 10.25.0, laravel/scout 10.2.4, meilisearch/meilisearch-php: 1.6.0

Docker getmeili/meilisearch:v1.6 redis:latest

My conclusion: The queue is sent to Redis, but when processing, none of the items sent to the queue appear