2017 © Pedro Peláez
 

library ha-elasticsearch-middleware

Provides access to official Elasticsearch PHP API as a middleware implementation for ha framework. Automatically creates a client based on the configuration when it starts the application.

image

itrnka/ha-elasticsearch-middleware

Provides access to official Elasticsearch PHP API as a middleware implementation for ha framework. Automatically creates a client based on the configuration when it starts the application.

  • Wednesday, November 15, 2017
  • by itrnka
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Elasticsearch for ha framework

Provides access to official Elasticsearch PHP API as a middleware implementation for ha framework. Automatically creates a client based on the configuration when it starts the application., (*1)

Installation

Installation is available via composer:, (*2)

composer require itrnka/ha-elasticsearch-middleware

Requirements

This package is based on ha framework. Composer installs ha framework and Elasticsearch PHP API automatically if it is not already installed., (*3)

Configuration

Required configuration keys:, (*4)

  • name: by ha framework requirements
  • hosts: string[] list of elasticsearch hosts

Add your configuration to the configuration file in ha framework according to this example:, (*5)

$cfg['middleware'] = [

    // ...

    // elasticsearch - single server
    [
        ha\Middleware\NoSQL\Elasticsearch\Elasticsearch::class,
        [
            'name' => 'ES001',
            'hosts' => ['127.0.0.1:9200'],
        ]
    ],

    // elasticsearch - multi server
    [
        ha\Middleware\NoSQL\Elasticsearch\Elasticsearch::class,
        [
            'name' => 'ES002',
            'hosts' => ['10.10.10.1:9200', '10.10.10.2:9200'],
        ]
    ],

    // ...
];

Then the elasticsearch will be available as follows:, (*6)

// middleware instance
$es1 = main()->middleware->ES001;
$es2 = main()->middleware->ES002;

// es client (instance of \Elasticsearch\Client):
$es1Client = main()->middleware->ES001->driver();
$es2Client = main()->middleware->ES002->driver();

// or (this is the same)
$es1Client = main()->middleware->ES001->client();
$es2Client = main()->middleware->ES002->client();

The Versions

15/11 2017

dev-master

9999999-dev https://github.com/itrnka/ha-elasticsearch-middleware

Provides access to official Elasticsearch PHP API as a middleware implementation for ha framework. Automatically creates a client based on the configuration when it starts the application.

  Sources   Download

Apache-2.0

The Requires

 

by Avatar itrnka

elasticsearch ha ha-framework

15/11 2017

v1.0.2

1.0.2.0 https://github.com/itrnka/ha-elasticsearch-middleware

Provides access to official Elasticsearch PHP API as a middleware implementation for ha framework. Automatically creates a client based on the configuration when it starts the application.

  Sources   Download

Apache-2.0

The Requires

 

by Avatar itrnka

elasticsearch ha ha-framework

15/11 2017

v1.0.0

1.0.0.0 https://github.com/itrnka/ha-elasticsearch-middleware

Elasticsearch middleware for ha framework. This is a proxy to official elasticsearch API.

  Sources   Download

Apache-2.0

The Requires

 

by Avatar itrnka

elasticsearch ha

15/11 2017

v1.0.1

1.0.1.0 https://github.com/itrnka/ha-elasticsearch-middleware

Elasticsearch middleware for ha framework. This is a proxy to official elasticsearch API.

  Sources   Download

Apache-2.0

The Requires

 

by Avatar itrnka

elasticsearch ha