mercredi 4 janvier 2017

Laravel Scout with Elastic search not working

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 neccessary 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 search it returns 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 recored without index in ES the model throws error like index not found .But after adding data and all It seems empty. Do I missing anything ?

The whole same works fine with algolia.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2iIwEYf
via IFTTT

Aucun commentaire:

Enregistrer un commentaire