AlfredDobradi / laravel5-elastic by AlfredDobradi

Simple Elastic wrapper for Laravel 5
1,566
1
0
Package Data
Maintainer Username: AlfredDobradi
Maintainer Contact: alfreddobradi@gmail.com (Alfred Dobradi)
Package Create Date: 2015-04-13
Package Last Update: 2015-09-10
Language: PHP
License: MIT
Last Refreshed: 2020-05-24 15:18:52
Package Statistics
Total Downloads: 1,566
Monthly Downloads: 32
Daily Downloads: 0
Total Stars: 1
Total Watchers: 0
Total Forks: 3
Total Open Issues: 0

laravel5-elastic

Join the chat at https://gitter.im/AlfredDobradi/laravel5-elastic Simple Elastic wrapper for Laravel 5

This package was built on Elasticsearch/Elasticsearch. The only purpose of this package is to create a simpler way to use Elastic in Laravel 5.

Installation

First you'll have to add the package to your dependencies in your composer.json file.

{
    "require": {
        "adobradi/laravel5-elastic": "~1.0"
    }
}

Or just simply do composer require adobradi/laravel5-elastic ~1.0 in your project root.

Now you'll have to add the provider to the list in config/app.php:

    return [
        // ...
        'providers' => [
            // ...
            'Adobradi\Elastic\ElasticServiceProvider',
            // ...
        ]
        // ...
    ];

After this, the Elastic alias will be created and you'll be able to use the Elastic facade to make calls:

use Elastic;

class YourClass {
    function yourFunction()
    {
        $data = Elastic::search([
            'index' => 'your_index_name',
            'type' => 'article',
            'size' => 15
        ]);
    }
}