- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的目标是将FOQElasticBundle与我的Silex网站链接。
问题是FOQElasticBundle的documentationn声明我只需要在config.yml文件中放入一些基本内容即可。
另请:https://github.com/Exercise/FOQElasticaBundle#declare-a-client
到目前为止,我在任何地方都找不到config.yml文件,我也不知道是否必须创建它,以及是否在哪里放置它。
我使用Silex而不是Symfony本身在网站上做出了错误的选择吗?
还是可以加载FOQElasticBundle?
最佳答案
您不能直接在Silex中使用Symfony bundle 包。
Silex通过服务提供者集成了第三方库,这些服务提供者就像第三方库的某种适配器一样。
如果您想使用 bundle 包,我建议您最好使用Symfony。
否则,您可以尝试自己为Elastica库添加write a Service Provider
或直接将其集成,如下所示:
https://github.com/4devs/demo-silex/blob/master/web/index.php
$app['elastica.host'] = "localhost";
$app['elastica.port'] = 9200;
$app['elastica'] = function ($app) {
return new \Elastica\Client(array(
'host' => $app['elastica.host'],
'port' => $app['elastica.port']
));
};
关于symfony - Silex + FOQElasticaBundle,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20195569/
我的目标是将FOQElasticBundle与我的Silex网站链接。 问题是FOQElasticBundle的documentationn声明我只需要在config.yml文件中放入一些基本内容即可
我按照 https://github.com/Exercise/FOQElasticaBundle#readme 设置了 FOQElasticaBundle Elastica 和 FOQElastic
我开始用 Symfony 2 搞乱 Elastic Search Bundle,并对实体搜索功能有疑问。 如果你有这样的配置: foq_elastica: clients: default:
我目前正在通过 FOQElasticaBundle 在我的 Symfony2 应用程序中实现 Elasticsearch 到目前为止,基于应用于我的“故事”实体各个领域的提升,它一直运行良好。这是配置
我是一名优秀的程序员,十分优秀!