2017 © Pedro Peláez
 

symfony-bundle elasticsearch-bundle

Symfony Elasticsearch Bundle

image

caxy/elasticsearch-bundle

Symfony Elasticsearch Bundle

  • Tuesday, January 12, 2016
  • by caxy
  • Repository
  • 24 Watchers
  • 0 Stars
  • 39 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

elasticsearch-bundle

Create ElasticSearch client using 'config.yml', (*1)


Installation

composer.json

# composer.json

"require": {
    "ushios/elasticsearch-bundle": "0.0.*"
    ...
}

and run composer update command., (*2)

AppKernel.php

# app/AppKernel.php

public function registerBundles()
{
    bundles = array(
        // ...
        new Ushios\Bundle\ElasticSearchBundle\UshiosElasticSearchBundle(),
    );

    retrun bundles();
}

Configuration

config.yml, (*3)

# app/config/config.php

ushios_elastic_search:
    client:
        default:
            hosts: [ "localhost" ] # Require
        named:
            class: Your\ElasticSearch\Client
            hosts: [ "localhost", "127.0.0.1","localhost:9200", "127.0.0.1:9201" ]
            log_path: elasticsearch.log # Optional
            log_level: Logger::WARNING # Optional

Defaults

@see ElasticSearch PHP API -full list of configrations-, (*4)

Usage

Get client from service.

Using default settings ElasticSearch client., (*5)

# Bundle/Controller/Controller.php

public function fooAction()
{
    $es = $this->container->get('ushios_elastic_search_client');
    // or
    $es = $this->container->get('ushios_elastic_search_client.default');
}

Using named settings., (*6)

# Bundle/Controller/Controller.php

public function fooAction()
{
    $es = $this->container->get('ushios_elastic_search_client.named');
    get_class($es); // Your\ElasticSearch\Client
}

Client

@see elasticsearch/elasticsearch web site or Documentation, (*7)

The Versions

12/01 2016

dev-develop

dev-develop https://github.com/caxy/elasticsearch-bundle

Symfony Elasticsearch Bundle

  Sources   Download

MIT

The Requires

 

by Ushio Shugo

elasticsearch

30/10 2013

dev-master

9999999-dev https://github.com/ushios/elasticsearch-bundle

Symfony ElasticSearchBundle

  Sources   Download

MIT

The Requires

 

by Ushio Shugo

elasticsearch

30/10 2013

0.0.1

0.0.1.0 https://github.com/ushios/elasticsearch-bundle

Symfony ElasticSearchBundle

  Sources   Download

MIT

The Requires

 

by Ushio Shugo

elasticsearch