pr3set-llc/elemental-search
Composer 安装命令:
composer require pr3set-llc/elemental-search
包简介
Full text search for elemental module
README 文档
README
Introduction
This module integrates dnadesign/silverstripe-elemental into SilverStripe's Fulltext search and provides extensions to create search documents for your Pages or any data objects which you need to work with the full text search. The module comes in handy for systems where you dont want to make use of complex search systems like Solr.
Requirements
- SilverStripe ^4.0
- Elemental ^2.0
Installation
Install with Composer:
composer require silverstripers/elemental-search dev-master
Ensure you run dev/build?flush=1 to build your database and flush your cache.
Usage
Enable Full text search
The module once installed elables Full text search by itself on the SearchDocument dataobject. There are no additional configs you want to use.
Create a search form
Create a search form with the code below and display on a template
use SilverStripe\CMS\Search\SearchForm;
class MyController extends Controller {
public function SearchForm()
{
return SearchForm::create($this, 'SearchForm');
}
public function results($data, $form, $request)
{
$data = array(
'Results' => $form->getResults(),
'Query' => DBField::create_field('Text', $form->getSearchQuery()),
'Title' => _t('SilverStripe\\CMS\\Search\\SearchForm.SearchResults', 'Search Results')
);
return $this->owner->customise($data)->renderWith(array('Page_results', 'Page'));
}
}
Include objects to search.
Any data object you'd like to include in the search has to be decorated with the SilverStripers\ElementalSearch\Extensions\SearchDocumentGenerator. After doing this this extension will make a search document each time when the data object is created, updated, and when deleted it will delete the search document. For Versioned data objects it will only create search documents when the object is published.
Specify which contents needs to be searched.
For the webpages you have the option to configure which dom elements to include in the search. Eg: You wont need it to cache the whole page and run search on certain info which duplicates over the site like the navigations.
SilverStripers\ElementalSearch\Model\SearchDocument:
search_x_path:
- main-content
In the situation where you have content outside of elemental elements that you want to include in the search.
SilverStripers\ElementalSearch\Model\SearchDocument:
only_use_x_path: true
The above settings will render the page and exract content within the main-content DOM node, and create the document.
How it works
The module adds a new DataObject SearchDocument. This gets created when each of the search enabled pages. And it is how it creates aggregated search results.
The module overrides the MySQLDatabase and the search result queries.
Reporting Issues
Please create an issue for any bugs, or submit merge requests.
pr3set-llc/elemental-search 适用场景与选型建议
pr3set-llc/elemental-search 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 13 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 10 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「search」 「silverstripe」 「full text」 「elemental」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 pr3set-llc/elemental-search 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 pr3set-llc/elemental-search 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 pr3set-llc/elemental-search 相关的其它包
同方向 / 同关键字的高下载量 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
Analytics chooser extensions for site settings.
Pimcore 10.x Website Indexer (powered by Zend Search Lucene)
统计信息
- 总下载量: 13
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2025-10-12