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.
In case you are using elastic search, check the error log - I had:
IF that`s the case,disable the disk check,at least for testing
Or make those changes permanent in elasticsearch.yml and restart the service.