phlexible/elastica-bundle

phlexible elastica bundle

安装: 397

依赖者: 3

建议者: 0

安全: 0

星标: 0

关注者: 2

分支: 0

开放问题: 0

类型:symfony-bundle

1.3.0 2017-08-16 12:27 UTC

This package is auto-updated.

Last update: 2024-09-08 07:22:15 UTC


README

PhlexibleElasticaBundle 在 phlexible 中添加了对 elasticsearch 索引的支持。

安装

  1. 使用 composer 下载 PhlexibleElasticaBundle
  2. 启用 Bundle
  3. 配置 PhlexibleElasticaBundle
  4. 清除 symfony 缓存

步骤 1:使用 composer 下载 PhlexibleElasticaBundle

通过运行以下命令添加 PhlexibleElasticaBundle

$ php composer.phar require phlexible/elastica-bundle "~1.0.0"

Composer 会将 Bundle 安装到您的项目的 vendor/phlexible 目录中。

步骤 2:启用 Bundle

在内核中启用 Bundle

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Phlexible\Bundle\ElasticaBundle\PhlexibleElasticaBundle(),
    );
}

步骤 3:配置 PhlexibleElasticaBundle

启用 Bundle 后,您需要配置 PhlexibleElasticaBundle。将以下配置添加到您的 config.yaml 文件中。

# app/config/config.yaml
phlexible_elastica:
    clients:
        default:
            host: your_elasticsearch_host
            port: 9200
            logger: logger
    indexes:
        default:
            index_name: your_index_name

步骤 4:清除 symfony 缓存

如果您使用环境 prod 访问 phlexible 应用程序,请清除缓存

$ php app/console cache:clear --env=prod