psvneo / sw-plugin-advanced-search
此包已被废弃,不再维护。没有建议的替代包。
1.0.0
2019-11-07 15:18 UTC
Requires
- php: ^7.1
- ext-pdo: *
- shopware/shopware: >=5.2 <5.6
Requires (Dev)
- phpmd/phpmd: ^2.7
- phpstan/phpstan: 0.11.*
- squizlabs/php_codesniffer: ^3.4
This package is auto-updated.
Last update: 2022-04-13 09:08:58 UTC
README
工作原理
此插件挂钩到搜索过程,并通过额外数据丰富搜索结果。要提供额外数据,您必须创建一个索引器。插件通过服务标签机制收集这些索引器。
如何添加自定义索引器
要添加自定义索引器,您必须在您的services.xml中注册一个服务。
<service class="Vendor\Component\Indexer\MyCustomIndexer" id="my.service.id">
<argument type="service" id="dbal_connection"/>
<tag name="psvneo_advanced_search.indexer"/>
</service>
标签 psvneo_advanced_search.indexer
非常重要。您类 Vendor\Component\Indexer\MyCustomIndexer
必须实现接口 \PSVneoAdvancedSearch\Component\Indexer\IndexerInterface
。
一个很好的例子是 PageIndexer。
如何索引
要索引记录,有一个symfony命令。只需运行
bin/console psvneo:search:index