I tried
Using Elastic search with Laravel scout with packages
"laravel/scout": "^1.0",
"tamayo/laravel-scout-elastic": "^1.0"
Ran Elasticsearch server in localhost:9200 and created index and gave necessary config's,
added searchable trait's to the model,
and imported data to index like
php artisan scout:import "App\story"
Imported [App\story] models up to ID: 4
All [App\story] records have been imported.
But when I do a search it returns an empty array
story::search("the")->get()
=> Illuminate\Database\Eloquent\Collection {#754
all: [],
}
when I do curl also it shows like,
// http://localhost:9200/author/_search?pretty=true&q=*:*
{
"took": 1,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 0,
"max_score": null,
"hits": [
]
}
}
When I adding the record without index in ES the model throws an error like index not found
. But after adding data and all, it seems empty. Did I miss anything?
The whole same works fine with algolia.
Set QUEUE=sync or you could turn off queue on config/scout.php.
Had the same issue: https://github.com/ErickTamayo/laravel-scout-elastic/issues/43
I had the same issue. Delete your index in Elasticsearch and run:
php artisan scout:import App\\story
Let scout create it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With