PHPackages                             silverstripe/solr - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Search &amp; Filtering](/categories/search)
4. /
5. silverstripe/solr

ActiveSilverstripe-module[Search &amp; Filtering](/categories/search)

silverstripe/solr
=================

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

6.0.0(7y ago)1914.0k18[10 issues](https://github.com/nyeholt/silverstripe-solr/issues)[11 PRs](https://github.com/nyeholt/silverstripe-solr/pulls)BSD-3-ClausePHP

Since Feb 11Pushed 7y ago3 watchersCompare

[ Source](https://github.com/nyeholt/silverstripe-solr)[ Packagist](https://packagist.org/packages/silverstripe/solr)[ RSS](/packages/silverstripe-solr/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (31)Used By (0)

Solr Search Module
==================

[](#solr-search-module)

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
===================

[](#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](https://github.com/nglasl/silverstripe-extensible-search)module for a search page implementation

Requirements
============

[](#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
===============================

[](#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
====================

[](#quick-usage-overview)

Install Solr (packages available for most OSes)
-----------------------------------------------

[](#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.

```

```

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
------------------

[](#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.

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

Using facets
------------

[](#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
----------------

[](#template-options)

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

API
===

[](#api)

[GitHub Wiki](http://wiki.github.com/nyeholt/silverstripe-solr)

Administration
==============

[](#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
===============

[](#troubleshooting)

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

Maintainer Contact
==================

[](#maintainer-contact)

Marcus Nyeholt

&lt;marcus (at) silverstripe (dot) com (dot) au&gt;

Licensing
=========

[](#licensing)

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

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance9

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 92.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~70 days

Recently: every ~124 days

Total

29

Last Release

2876d ago

Major Versions

3.2.1 → 4.0.02014-08-21

4.1.0 → 5.0.02016-01-22

3.0.x-dev → 4.1.x-dev2016-05-16

4.1.1 → 5.1.02016-08-16

5.4.x-dev → 6.0.02018-07-04

### Community

Maintainers

![](https://www.gravatar.com/avatar/b0cba8b534e20e6ab4fff555a97b237a18436ebca1446fc0b29c8a8b504038b9?d=identicon)[GuySartorelli](/maintainers/GuySartorelli)

---

Top Contributors

[![nyeholt](https://avatars.githubusercontent.com/u/161730?v=4)](https://github.com/nyeholt "nyeholt (140 commits)")[![ajshort](https://avatars.githubusercontent.com/u/31570?v=4)](https://github.com/ajshort "ajshort (7 commits)")[![johannesx75](https://avatars.githubusercontent.com/u/3908339?v=4)](https://github.com/johannesx75 "johannesx75 (4 commits)")

---

Tags

searchsilverstripesolr

### Embed Badge

![Health badge](/badges/silverstripe-solr/health.svg)

```
[![Health](https://phpackages.com/badges/silverstripe-solr/health.svg)](https://phpackages.com/packages/silverstripe-solr)
```

###  Alternatives

[g4b0/searchable-dataobjects

This module adds DataObjects to frontend search

254.9k](/packages/g4b0-searchable-dataobjects)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
