定制 pedromdev/elasticsearch-module 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

pedromdev/elasticsearch-module

Composer 安装命令:

composer require pedromdev/elasticsearch-module

包简介

Zend Framework 2 Module for Elasticsearch

README 文档

README

Build Status Scrutinizer Code Quality Coverage Status

Integration between the Elasticsearch-PHP client and Zend Framework 2

Installation

The installation is made through Composer. Add the dependency in your composer.json:

{
    "require": {
        "pedromdev/elasticsearch-module": "~1.0"
    }
}

Then run command for installation:

php composer.phar install --no-dev

Or run update command if you already have an installation:

php composer.phar update --no-dev

After Composer install all dependencies, add ElasticsearchModule to your application.config.php:

<?php

return [
    'modules' => [
        'ElasticsearchModule',
    ],
];

ElasticsearchModule services and configurations

Note: These services and configurations are based on the DoctrineModule/DoctrineORMModule services and configurations.

Services

Registered services

  • elasticsearch.loggers.default: an \ArrayObject instance with \Psr\Log\LoggerInterface instances. Each instance is associated to a key in loggers configuration;
  • elasticsearch.handler.default: default middleware callable;
  • elasticsearch.connection_factory.default: an \Elasticsearch\Connections\ConnectionFactoryInterface instance;
  • elasticsearch.connection_pool.default: an \Elasticsearch\ConnectionPool\AbstractConnectionPool instance;
  • elasticsearch.transport.default: an \Elasticsearch\Transport instance;
  • elasticsearch.endpoint.default: default callable to retrieve an \Elasticsearch\Endpoints\AbstractEndpoint instances. Its only parameter is an endpoint class name (e.g., Get, Bulk, Delete);
  • elasticsearch.client.default: an \Elasticsearch\Client instance;
  • Elasticsearch\Client: an alias of elasticsearch.client.default.

Usage

<?php

$client = $serviceLocator->get('elasticsearch.client.default');
$client = $serviceLocator->get('Elasticsearch\Client');

Configuration

Create a config/autoload/elasticsearch.global.php file with the below content:

<?php

return [
    'elasticsearch' => [
        'connection_pool' => [
            'default' => [
                'hosts' => [
                    'http://localhost:9200', // string based
                    'http://username:password@localhost:9200', // if you have an authentication layer
                    [
                        'scheme' => 'http', // associative array based
                        'host' => 'localhost',
                        'port' => 9200,
                        'user' => 'username', // if you have an authentication layer
                        'pass' => 'password',
                    ],
                ],
            ],
        ],
    ],
];

统计信息

  • 总下载量: 103
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2017-02-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固