承接 arckinteractive/elgg_solr 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

Installation

  1. Download the plugin and upload it to /mod/elgg_solr, or install with composer composer require arckinteractive/elgg_solr:~2.0

  2. In Admin > Plugins, reorder the elgg_solr plugin to be positioned under search plugin, and enable it

  3. Create a new Solr instance and configure it:

    • Make sure that /<instance>/conf/solrconfig.xml is set to use classic index schema: <schemaFactory class="ClassicIndexSchemaFactory"></schemaFactory>
    • Copy contents of install/schema.xml (or install/schema.solr5.xml for Solr 5+) included in the root of the plugin to /<instance>/conf/schema.xml
      • Copy contents of install/solrconfig.solr5.xml to `//conf/solrconfig.xml if using solr 5
  4. Update elgg_solr plugin settings to point to the new Solr instance

  5. Trigger a reindex from the plugin setting page

  6. 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 - guid
  • type - entity type
  • subtype - entity subtype
  • owner_guid - guid of the owner
  • container_guid - guid of the container
  • access_id - access level
  • title - title
  • name - name
  • description - description
  • time_created - timestamp of the creation
  • time_updated_i - timestamp of the last update
  • enabled - is entity enabled
  • tag_<tag_name>_ss - tags for registered tag metadata names
  • has_pic_b - flag indicating that entity has an uploaded icon
  • responses_thread_i - guid of the comment/reply thread root
  • responses_is - guids of comments/replies
  • responses_count_i - total count of comments/replies
  • likes_count_i - total count of likes

User

In addition to Entity fields:

  • username - username
  • profile_<field_name>_s - profile fields with a single value
  • profile_<field_name>_ss - profile fields with multiple values (tags)
  • groups_is - guids of groups a user is member of
  • groups_count_i - total number of groups a user is a member of
  • friends_is - guids of user's friends
  • friends_count_i - total number of friends
  • last_login_i - timestamp of the last login
  • last_action_i - timestamp of the last activity
  • has_pic_b - flag indicating that user has an avatar

Group

In addition to Entity fields:

  • group_<field_name>_s - profile fields with a single value
  • group_<field_name>_ss - profile fields with multiple values (tags)
  • members_is - guids of group members
  • members_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 contents
  • simpletype_s - simple type (e.g. image, document etc)
  • mimetype_s - detected mime type (e.g. application/json)
  • originalfilename_s - original name of the uploaded file
  • filesize_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 我们能提供哪些服务?
定制开发 / 二次开发

基于 arckinteractive/elgg_solr 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 450
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 21
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 8
  • Forks: 8
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-only
  • 更新时间: 2015-09-16