in-square/opendxp-simple-search-bundle
Composer 安装命令:
composer require in-square/opendxp-simple-search-bundle
包简介
MySQL FULLTEXT based frontend search index for OpenDXP (Documents + DataObjects).
README 文档
README
Bundle for full-text search in OpenDXP 11 using MySQL FULLTEXT index
Install the bundle
composer require in-square/opendxp-simple-search-bundle
Create a configuration
touch config/packages/in_square_opendxp_simple_search.yaml
Basic configuration
#config/packages/insquare_opendxp_simple_search.yaml in_square_opendxp_simple_search: table_name: 'insquare_search_index' locales: ['pl', 'en'] sites: [0] index_documents: true index_objects: true max_content_length: 20000 snippet_length: 220 use_boolean_mode: true min_search_length: 3
Register bundle in bundles.php
<?php // config/bundles.php return [ // other bundles InSquare\OpendxpSimpleSearchBundle\InSquareOpendxpSimpleSearchBundle::class => ['all' => true], ];
Create object extractors
isValid() allows you to skip indexing for a given object/locale combination.
<?php // src/Search/Extractor/ProductExtractor.php namespace App\Search\Extractor; use InSquare\OpendxpSimpleSearchBundle\Service\Extractor\ObjectContentExtractorInterface; use InSquare\OpendxpSimpleSearchBundle\Service\Text\TextNormalizer; use OpenDXP\Model\DataObject\Concrete; use OpenDXP\Model\DataObject\Product; final readonly class ProductExtractor implements ObjectContentExtractorInterface { public function getSupportedClass(): string { return Product::class; } public function isValid(Concrete $object, string $locale): bool { return $object instanceof Product && $object->isPublished(); } public function extractContent(Concrete $object, string $locale): ?string { if (!$object instanceof Product) { return null; } return TextNormalizer::join([ $object->getName($locale), $object->getDescription($locale), $object->getSku(), ]); } }
Register extractor as a tagged service
#config/services.yaml services: App\Search\Extractor\ProductExtractor: tags: - { name: 'insquare.search.object_extractor' }
Bundle will automatically detect the extractor and assign it to the Product class.
Run the installation command
bin/console insquare:search:install
Index all items
bin/console insquare:search:reindex
Symfony Messenger
Start the messenger worker
bin/console messenger:consume async -vv
Route bundle message to async transport (recommended):
# config/packages/messenger.yaml framework: messenger: routing: InSquare\OpendxpSimpleSearchBundle\Message\IndexElementMessage: async
Use in the controller
use InSquare\OpendxpSimpleSearchBundle\Service\SearchService; class SearchController extends AbstractController { public function __construct( private readonly SearchService $searchService ) {} #[Route('/search')] public function search(Request $request): Response { $query = $request->query->get('q'); $locale = $request->getLocale(); $results = $this->searchService->search( query: $query, locale: $locale, site: 0, limit: 20, offset: 0 ); return $this->render('search/results.html.twig', [ 'results' => $results, 'query' => $query ]); } }
in-square/opendxp-simple-search-bundle 适用场景与选型建议
in-square/opendxp-simple-search-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 04 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「search」 「opendxp」 「opendxp-bundle」 「opendxp-plugin」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 in-square/opendxp-simple-search-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 in-square/opendxp-simple-search-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 in-square/opendxp-simple-search-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Laravel package to retrieve data from Google Search Console
Indexed Search Autocomplete - Extends the TYPO3 Core Extension Indexed_Search searchform with an autocomplete feature.
Abstraction Layer to index and search entities
Pimcore 10.x Website Indexer (powered by Zend Search Lucene)
Symfony bundle for Elasticsearch integration with round-robin load balancing
A universal search system for App-UI
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 23
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2026-04-17