lundi 22 février 2016

Elasticsearch in laravel 5.1

I want to integrate elasticsearch in my laravel project.

I have installed using following line :

Run command on terminal :

composer require shift31/laravel-elasticsearch:~1.0

Then i have created elasticsearch.php in app/config/ and added following code.

<?php

use Monolog\Logger;

return array(
    'hosts' => array(
                    'your.elasticsearch.server:9200' // what should be my host ?
                    ),
    'logPath' => 'path/to/your/elasticsearch/log',
    'logLevel' => Logger::INFO
);

My first question : What should i write in place of host name

Right now my project is running on local server with localhost:8000.

I have added Shift31\LaravelElasticsearch\ElasticsearchServiceProvider in app/config/app.php for enable the 'Es' facade.

Above all things done. Now in which file i should add the code of elasticsearch to add, update, delete and search the records.

I have product table I need to add product records in elasticsearch, when update product, records should be update.

I have no idea of the further process. Please guide me I have searched on google but no any example help me.



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

Aucun commentaire:

Enregistrer un commentaire