php - Elastiquent Elasticsearch in Laravel 5.2 -


after days of searching, have decided come here , ask.

i have used package before, , literally copy-pasted code still wont work in project.

i trying use elasticquent package elasticsearch in laravel 5.2.

the error is: invalid argument supplied foreach() being thrown in /vendor/elasticsearch/elasticsearch/src/elasticsearch/clientbuilder.php file on line 111.

this happens whenever try use package (ie: using search, addalltoindex, etc.).

from can tell, config null, maybe there setting in elasticquent missed?

any ideas on how fix this?

edit

my config/elasticquent.php file (exact same `vendor/elasticquent/elasticquent/src/config/elasticquent.php):

<?php  return array(      /*     |--------------------------------------------------------------------------     | custom elasticsearch client configuration     |--------------------------------------------------------------------------     |     | array passed elasticsearch client.     | see configuration options here:     |     | http://www.elasticsearch.org/guide/en/elasticsearch/client/php-api/current/_configuration.html     */      'config' => [         'hosts'     => ['localhost:9200'],         'retries'   => 1,     ],      /*     |--------------------------------------------------------------------------     | default index name     |--------------------------------------------------------------------------     |     | index name elastiquent use     | elastiquent models.     */      'default_index' => 'my_custom_index_name',  ); 

edit 2 result curl -xget localhost:9200:

{   "name" : "mac gargan",   "cluster_name" : "elasticsearch",   "version" : {     "number" : "2.3.2",     "build_hash" : "b9e4a6acad4008027e4038f6abed7f7dba346f94",     "build_timestamp" : "2016-04-21t16:03:47z",     "build_snapshot" : false,     "lucene_version" : "5.5.0"   },   "tagline" : "you know, search" } 

edit 3 issue, didn't manage solve it. had use package mustafaaloko/elasticquent5 found here

here answer in invalid argument supplied foreach()

i source code , find problem config doesn't commit expected, can clear cache , publish vendor, work me

php artisan config:clear php artisan cache:clear php artisan vendor:publish


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -