2017 © Pedro Peláez
 

library elasticsearch

A Laravel 4 Service Provider for the Elasticsearch API client

image

diimu/elasticsearch

A Laravel 4 Service Provider for the Elasticsearch API client

  • Thursday, December 12, 2013
  • by diimu
  • Repository
  • 0 Watchers
  • 0 Stars
  • 1 Installations
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Elasticsearch for Laravel 4

This is a Laravel 4 Service Provider for the offical Elasticsearch API client: http://www.elasticsearch.org/guide/en/elasticsearch/client/php-api/current/index.html, (*1)

Usage

  1. Require "shift31/laravel-elasticsearch": "dev-master" in your composer.json, (*2)

  2. Create app/config/elasticsearch.php, modifying the following contents accordingly:, (*3)

    return array(
        'hosts' => array(
                        'your.elasticsearch.server:9200'
                    ),
        'logPath' => 'path/to/your/elasticsearch/log'
        'logLevel' => Logger::INFO;
    );
  3. Add 'Shift31\LaravelElasticsearch\LaravelElasticsearchServiceProvider' to your 'providers' array in app/config/app.php, (*4)

  4. Use the Es facade to access any method from the Elasticsearch\Client class, for example:, (*5)

    $searchParams['index'] = 'your_index';
    $searchParams['size'] = 50;
    $searchParams['body']['query']['query_string']['query'] = 'foofield:barstring';
    
    $result = Es::search($searchParams);

Default Configuration

If you return an empty array in the config file:, (*6)

'hosts' defaults to localhost:9200, (*7)

'logPath' defaults to storage_path() . '/logs/hostbase-elasticsearch-' . php_sapi_name() . '.log', (*8)

'logLevel' defaults to Logger::INFO, (*9)

The Versions

12/12 2013

dev-master

9999999-dev

A Laravel 4 Service Provider for the Elasticsearch API client

  Sources   Download

The Requires

 

by Shift 31 Consulting