承接 silverstripe/solr 相关项目开发

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

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

silverstripe/solr

Composer 安装命令:

composer require silverstripe/solr

包简介

Solr integration for SilverStripe. Note that this is NOT related to the silverstripe/fulltext package.

README 文档

README

A module that extends the base functionality of the extensible search module, adding the ability to index and search content from a Solr instance.

Version Information

  • The 2.0 branch is compatible with SilverStripe 3.0
  • The 3.0 branch is compatible with SilverStripe 3.1 and contains its own SearchPage implementation
  • The master branch is compatible with SilverStripe 3.1, but relies on the Extensible Search module for a search page implementation

Requirements

  • Solr 4.0 installed and running (a test instance is included, but for production use, please install and configure)
  • The extensible search module if you're wanting to have a CMS configurable search page.

Extensible Search Upgrade Notes

If you have recently been using the solr search module prior to the extensible search upgrade, the following steps will need to be taken.

  • Add the configuration from extensions.yml.sample to your project configuration to bind the SolrSearch extension to the ExtensibleSearchPage
  • Replace most YML and code SolrSearchPage references with ExtensibleSearchPage, unless you have something which still directly depends on the new SolrSearch extension.
  • /dev/tasks/SolrSearchPageMigrationTask to update all search page references

Quick Usage Overview

Install Solr (packages available for most OSes)

For demonstration and testing purposes, a standalone Jetty based installation of solr is available in the solr/ subdirectory. To execute, simply change to that directory and run java -jar start.jar - the default settings will be fine for evaluation.

If you are running a custom Solr instance, make sure to copy the solr/solr/solr/collection1/conf/schema.xml file to your solr instance - there are a couple of custom types defined that SilverStripe uses; the XML for these is below, if you want to place in your own schema.xml file.

   <!-- SilverStripe multivalue field and sortable support -->
   <dynamicField name="*_ms"  type="string"  indexed="true"  stored="true" multiValued="true"/>
   <dynamicField name="*_as"  type="alphaOnlySort"  indexed="true"  stored="true"/>

If you have a configuration different to the default locahost:8983/solr configuration, you can configure things by calling

SolrSearchService::$solr_details = array();

Add the extensions

The following YAML will need to be added when using the extensible search page, so the solr search engine appears.

ExtensibleSearchPage:
  search_engine_extensions:
    SolrSearch: 'Solr'
  extensions:
    - 'SolrSearch'
ExtensibleSearchPage_Controller:
  extensions:
    - 'SolrSearch_Controller'

Add the SolrIndexable extension to any SiteTree objects you want to search. Support for other data objects may work, though file indexing is not yet supported

Object::add_extension('SiteTree', 'SolrIndexable');

By default, the solr indexer will index Title and Content fields. If you want other fields indexed too, add them to your $searchable_fields static variable in your class type.

There is also an optional set of extensions available if you wish to enable an additional SiteTree index based on user permissions (rather than filtering the search result's response).

This will require the Queued Jobs module to function, due to the recursive indexing when saving a page. https://github.com/silverstripe-australia/silverstripe-queuedjobs

Object::add_extension('SiteTree', 'SiteTreePermissionIndexExtension');
Object::add_extension('ExtensibleSearchPage', 'SolrSearchPermissionIndexExtension');

Using facets

First, you need to tell the search page what you're going to be faceting on

SolrSearch::$facets = array('MetaKeywords_ms');

then make sure that field (MetaKeywords) is included in the list of fields to index via the searchable_fields static.

*_ms represents a multivalue field. *_as represents a sortable field (which doesn't require tokenization).

Template options

To customise search results displayed, provide a SolrSearch_results.ss file in your theme's templates directory.

API

GitHub Wiki

Administration

If you have ADMIN privileges, you can start and stop the locally bundled jetty version of solr from within the CMS on the Solr admin section.

To set the java path (if different from /usr/bin/java), set

SolrSearchService::$java_bin

to the appropriate path

Troubleshooting

If you aren't getting any search results, first make sure Solr is running and has been indexed.

Maintainer Contact

Marcus Nyeholt

<marcus (at) silverstripe (dot) com (dot) au>

Licensing

Solr is licensed under the Apache License This module is licensed under the BSD license

silverstripe/solr 适用场景与选型建议

silverstripe/solr 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 13.98k 次下载、GitHub Stars 达 19, 最近一次更新时间为 2013 年 02 月 11 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「solr」 「search」 「silverstripe」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 silverstripe/solr 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 silverstripe/solr 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 13.98k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 19
  • 点击次数: 20
  • 依赖项目数: 0
  • 推荐数: 1

GitHub 信息

  • Stars: 19
  • Watchers: 3
  • Forks: 18
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2013-02-11