kyfjake/laravel-es

There is no license information available for the latest version (dev-master) of this package.

es for laravel

dev-master 2019-07-31 02:42 UTC

This package is not auto-updated.

Last update: 2024-12-13 03:47:46 UTC


README

Laravel elastic search service provider.

Install

composer require kyfjake/laravel-es
php artisan laravel-es publish

Config

edit file config/laravel-es.php

<?php

return [
    # es host
    'hosts' => explode(',', env('ES_HOST', 'localhost')),
    # retries times
    'retries' => 2,
];

More Config

Usage

app('es') return \Elasticsearch\Client object

app('es')->search([
        'index' => 'twitter',
        'type' => '_doc' 
        'body' => [],     
    ])

More Usage About \Elasticsearch\Client