goldenline / algolia-bundle
将 Algolia 集成到 Symfony
1.1.1
2022-06-13 04:47 UTC
Requires
- php: >=5.4
- algolia/algoliasearch-client-php: 1.5.*
- symfony/framework-bundle: ~2.3
Requires (Dev)
This package is not auto-updated.
Last update: 2024-09-11 13:23:43 UTC
README
将 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