arckinteractive/elgg_solr
Composer 安装命令:
composer require arckinteractive/elgg_solr
包简介
Basic solr integration to replace elgg search
关键字:
README 文档
README
Speed up site search by using a dedicated Solr search index
- Search Entities
- Search tags (exact match)
- Search File contents
This plugin follows the structure of the default Elgg search plugin, can be extended using the same search plugin hooks.
Dependencies
- This plugin depends on the default elgg search plugin (bundled with Elgg)
- This plugin depends on the vroom plugin - https://github.com/jumbojett/vroom
Installation
-
Download the plugin and upload it to
/mod/elgg_solr, or install with composercomposer require arckinteractive/elgg_solr:~2.0 -
In Admin > Plugins, reorder the
elgg_solrplugin to be positioned undersearchplugin, and enable it -
Create a new Solr instance and configure it:
- Make sure that
/<instance>/conf/solrconfig.xmlis set to use classic index schema:<schemaFactory class="ClassicIndexSchemaFactory"></schemaFactory> - Copy contents of
install/schema.xml(orinstall/schema.solr5.xmlfor Solr 5+) included in the root of the plugin to/<instance>/conf/schema.xml- Copy contents of
install/solrconfig.solr5.xmlto `//conf/solrconfig.xml if using solr 5
- Copy contents of
- Make sure that
-
Update
elgg_solrplugin settings to point to the new Solr instance -
Trigger a reindex from the plugin setting page
-
Ensure that daily cron is configured and active
Plugin hooks
search, <search_type>
search, <entity_type>
search, <entity_type>:<entity_subtype>
These hooks can be used to modify search criteria
elgg_solr:index, <entity_type>
elgg_solr:index, <entity_type>:<entity_subtype>
elgg_solr:index, annotation
These hooks can be used to customize indexed fields
elgg_solr:can_index, annotation
Allows to add annotations to index by name
elgg_solr:access, entities
Allows plugins to add additional access queries.
Indexing
Tuning indexed values
Indexed values can be customized using 'elgg_solr:index',<entity_type>' hook:
elgg_register_plugin_hook_handler('elgg_solr:index', 'object', function($hook, $type, $return, $params) { $entity = elgg_extract('entity', $params); if (!$entity instanceof Event) { return; } $return->custom_field_s = $entity->custom_field; $return->start_time_i = $entity->start_time; return $return; });
Adding annotations to index
To add an annotation to the index, add annotation name to the return of the 'elgg_solr:can_index','annotation':
elgg_register_plugin_hook_handler('elgg_solr:can_index', 'annotation', function($hook, $type, $return) { $return[] = 'revision'; return $return; });
Indexed values
Entity
id- guidtype- entity typesubtype- entity subtypeowner_guid- guid of the ownercontainer_guid- guid of the containeraccess_id- access leveltitle- titlename- namedescription- descriptiontime_created- timestamp of the creationtime_updated_i- timestamp of the last updateenabled- is entity enabledtag_<tag_name>_ss- tags for registered tag metadata nameshas_pic_b- flag indicating that entity has an uploaded iconresponses_thread_i- guid of the comment/reply thread rootresponses_is- guids of comments/repliesresponses_count_i- total count of comments/replieslikes_count_i- total count of likes
User
In addition to Entity fields:
username- usernameprofile_<field_name>_s- profile fields with a single valueprofile_<field_name>_ss- profile fields with multiple values (tags)groups_is- guids of groups a user is member ofgroups_count_i- total number of groups a user is a member offriends_is- guids of user's friendsfriends_count_i- total number of friendslast_login_i- timestamp of the last loginlast_action_i- timestamp of the last activityhas_pic_b- flag indicating that user has an avatar
Group
In addition to Entity fields:
group_<field_name>_s- profile fields with a single valuegroup_<field_name>_ss- profile fields with multiple values (tags)members_is- guids of group membersmembers_count_i- total number of group members
File
To index file contents, enable extraction (extract_handler) in plugin settings.
In addition to Entity fields:
attr_content- extracted contentssimpletype_s- simple type (e.g.image,documentetc)mimetype_s- detected mime type (e.g.application/json)originalfilename_s- original name of the uploaded filefilesize_i- file size in bytes
arckinteractive/elgg_solr 适用场景与选型建议
arckinteractive/elgg_solr 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 450 次下载、GitHub Stars 达 6, 最近一次更新时间为 2015 年 09 月 16 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「plugin」 「solr」 「search」 「scalability」 「elgg」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 arckinteractive/elgg_solr 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 arckinteractive/elgg_solr 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 arckinteractive/elgg_solr 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
CakePHP 4.x AdminLTE Theme.
A bundle which extend ibexa solr search handler
A Laravel package to retrieve data from Google Search Console
This extension provides integration with solr to output content from TYPO3 in JSON format.
Laminas Module for interaction between a laminas application and a SOLR search engine using Solarium
Indexed Search Autocomplete - Extends the TYPO3 Core Extension Indexed_Search searchform with an autocomplete feature.
统计信息
- 总下载量: 450
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-only
- 更新时间: 2015-09-16