承接 pmg/elasticsearch-bundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

pmg/elasticsearch-bundle

最新稳定版本:4.0.0

Composer 安装命令:

composer require pmg/elasticsearch-bundle

包简介

An extremely simple Elasticsearch bundle for Symfony

README 文档

README

Build Status

This is an extremely simple bundle to integrate Elasticsearch into Symfony. It only provides some configuration and the elasticsearch client.

Installation

Grab the bundle with composer:

composer require pmg/elasticsearch-bundle ~1.0

And enable it in your AppKernel.

<?php
// app/AppKernel.php

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            // ...
            new PMG\ElasticsearchBundle\PmgElasticsearchBundle(),
        );

        // ...

        return $bundles;
    }

    // ...
}

Configuration

You'll use the pmg_elasticsearch key in your config.yml file. The options are very similar to what is done with with elasticsearch itself. Most of the options here are null and use the default set by Elasticsearch\Client.

You can set up multiple connections:

pmg_elasticsearch:
    default_client: example
    clients:
        example:
            connection_class: ~
            connection_factory_class: ~
            connection_pool_class: ~
            selector_class: ~
            serializer_class: ~
            sniff_on_start: ~
            hosts:
                - http://localhost:9200
        another: ~

Or just a single client:

pmg_elasticsearch:
    connection_class: ~
    connection_factory_class: ~
    connection_pool_class: ~
    selector_class: ~
    serializer_class: ~
    sniff_on_start: ~
    hosts:
        - http://localhost:9200

Services

The pmg_elasticsearch.client service will always be the default client. Other clients can be accessed with pmg_elasticsear.{name}.client.

use Symfony\Component\DependencyInjection\ContainerInterface;

/** @var $container ContainerInterface */
$client = $container->get('pmg_elasticsearch.client');

$otherClient = $container->get('pmg_elasticsearch.another.client');

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-04-06