goldenline / algolia-bundle

将 Algolia 集成到 Symfony

安装次数: 64,370

依赖项: 1

建议者: 0

安全: 0

星标: 2

关注者: 16

分支: 1

公开问题: 0

类型:symfony-bundle

1.1.1 2022-06-13 04:47 UTC

This package is not auto-updated.

Last update: 2024-09-11 13:23:43 UTC


README

Dependency Status

将 Algolia 集成到 Symfony

安装

安装此扩展包的最佳方式是使用 Composer。只需运行

$ php composer.phar require goldenline/algolia-bundle 1.0.0

然后,启用扩展包

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Goldenline\AlgoliaBundle\GoldenlineAlgoliaBundle(),
    );
}

最后添加您的配置

# app/config/config.yml

goldenline_algolia:
    client:
        application_id: <your_application_id>
        application_key: <your_application_key>
    indices:
        foo:
            name: prefix_foo
        bar:
            name: bar

目前我们不支持 XML 配置。

使用方法

从容器中获取您的索引,例如。

  $this->getContainer()->get('goldenline_algolia.index.foo');

然后根据 https://github.com/algolia/algoliasearch-client-php#search 文档使用它。

您还可以根据 https://github.com/algolia/algoliasearch-client-php 使用容器中定位的客户端服务:goldenline_algolia.client

许可证

此扩展包在 MIT 许可证下发布。请参阅扩展包中的完整许可证。

Resources/meta/LICENSE