victoire / search-widget
此包已被废弃且不再维护。没有建议的替代包。
Victoire 搜索小部件
2.0.6
2018-08-01 17:32 UTC
Requires
- friendsofsymfony/elastica-bundle: ^3.1
- jms/serializer-bundle: ^1.0
- victoire/victoire: ~2.2 | ~3.0
This package is auto-updated.
Last update: 2021-12-21 22:52:39 UTC
README
Victoire 搜索包
此包的用途是什么
此包提供对 搜索小部件 的访问,这是一个可以搜索任何文本的搜索栏。
它与 elastica 一起工作,并在每个可搜索的小部件中自动搜索(归功于小部件嵌入的配置)。您放置一个发射点(即:搜索栏)并定义放置接收点的结果页面。
在 BusinessEntities 中的特定搜索
如果您要搜索 BusinessEntities,您必须为您的 BusinessEntities 定义自己的配置
fos_elastica: clients: default: { host: 127.0.0.1, port: 9200 } serializer: callback_class: FOS\ElasticaBundle\Serializer\Callback serializer: serializer indexes: # Widgets are automatically indexed by using 'victoire_search_widgets_index' parameter # You can override Widgets indexation configuration widgets: %victoire_search_widgets_index% # Pages are automatically indexed by using 'victoire_search_pages_index' parameter # You can override Pages indexation configuration pages: %victoire_search_pages_index% # You need to define the business entities you wish to index here business: types: Jedi: serializer: groups: [search] mappings: title: ~ city: ~ description: ~ contractType: ~ subtitle: ~ persistence: driver: orm model: Acme\DemoBundle\Entity\Jedi provider: ~ listener: ~ finder: ~
初始化 elasticsearch 映射
为了有一个相关的 elasticsearch 映射,您需要在运行任何查询之前运行以下命令
console fos:elastica:reset
设置 Victoire
如果您还没有设置 Victoire,您可以按照以下步骤设置 Victoire 这里
安装包
运行以下 composer 命令
php composer.phar require victoire/search-widget
提醒
请记住将包添加到您的 AppKernel 中!
class AppKernel extends Kernel { public function registerBundles() { $bundles = array( ... new Victoire\Widget\SearchBundle\VictoireWidgetSearchBundle(), new FOS\ElasticaBundle\FOSElasticaBundle(), ); return $bundles; } }