PHPackages                             somardesignstudios/silverstripe-elastic-search - 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. somardesignstudios/silverstripe-elastic-search

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

somardesignstudios/silverstripe-elastic-search
==============================================

A silverstripe module providing search with elasticsearch

0.4.3(3mo ago)04201[1 PRs](https://github.com/somardigital/silverstripe-elastic-search/pulls)BSD-3-ClausePHPPHP &gt;=8.2.0

Since Oct 19Pushed 3mo ago6 watchersCompare

[ Source](https://github.com/somardigital/silverstripe-elastic-search)[ Packagist](https://packagist.org/packages/somardesignstudios/silverstripe-elastic-search)[ RSS](/packages/somardesignstudios-silverstripe-elastic-search/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (5)Dependencies (5)Versions (18)Used By (0)

SilverStripe elastic search
===========================

[](#silverstripe-elastic-search)

Silverstripe module to provide site-wide content search with elasticsearch

Requirements
------------

[](#requirements)

- SilverStripe ^4.0
- [elasticsearch-php](https://github.com/elastic/elasticsearch-php)
- [ramsey/uuid](https://github.com/ramsey/uuid)
- [SilverStripe Queued Jobs Module](https://github.com/symbiote/silverstripe-queuedjobs)

Installation
------------

[](#installation)

1. Install the module

```
composer require somardesignstudios/silverstripe-elastic-search

```

3. Create `log` folder in the root of the project with permissions allowing write to the user running the site

Elastic connection configuration
--------------------------------

[](#elastic-connection-configuration)

Add your elasticsearch API keys to the .env file

```
# Elastic search
ELASTIC_CLOUD_ID=""
ELASTIC_INDEX=""

ELASTIC_API_ID=""
ELASTIC_API_KEY=""

```

Search configuration
====================

[](#search-configuration)

Field mappings configuration
----------------------------

[](#field-mappings-configuration)

Page content will be flattened and stored in a standard set of fields defined in this module's `search.yml`

You can add additional fields by adding a `search.yml` config to your own project. e.g.

```
---
Name: my_search
After:
  - "#somar_search"
---
Somar\Search\ElasticSearchService:
  mappingProperties:
    custom_field_one:
      type: text
      store: true
    custom_field_two:
      type: date
      store: true
```

Search fields
-------------

[](#search-fields)

You can change the default search fields and its weightings in config file, optionally you can define highlighting matches in matched fields:

```
Somar\Search\ElasticSearchService:
  searchFields:
    - title^2
    - keywords^2.5
    - content
  highlightFields:
    - content
```

Search page
-----------

[](#search-page)

On the Search page you will find a Vue component that is configurable via .yml files:

```
Somar\Search\PageType\SearchPage:
  searchConfig:
    headingLevel: 1
    allowEmptyKeyword: false
    secondarySearch: documents
    icons: material # adds material icon into the keyword field & dropdown tag close
    caretIconClass: "icon-dropdown" # adds  to dropdowns
    labels:
      title: Start typing to search the content # all title fields & subtitle can have placeholders and html
      titleFound: "Search results for “[searchedKeyword]”"
      titleSearching: "Searching for “[keyword]” ..."
      subtitle: "[resultsCount] results found"
      resultLinkText: Read more # uses URL of the result when not defined
      filtersHint: Refine your search results below by selecting popular filters and/or ordering them by date.
    filters:
      type:
      placeholder: Type of content
      field: type
      columns: 4 # width out of 12 columns on desktop, defaults to 6, set to 6 on tablet & 12 on mobile
      multiple: true # allows multiple values selected
      showInline: true # display all options inline rather than in dropdown
      default: news # preselected filter
      searchable: false
      iconClass: icon-type # adds  to dropdowns
      options:
        news:
          name: News
          filter: App\Page\NewsArticle
        events:
          name: Events
          filter: App\Page\Event
        content:
          name: Content
          filter:not:
            - App\Page\NewsArticle
            - App\Page\Event
            - App\Model\Document
        documents:
          name: Documents
          filter: App\Model\Document
      date:
        placeholder: By date
        field: sort_date
        options:
          desc:
            name: Most recent first
          asc:
            name: Oldest first
          range:
            name: Select dates
```

Search type
-----------

[](#search-type)

You can add additional configurations sets when multiple search pages with different configurations are needed. When an additional search type is defined, a dropdown will appear on the Search page. Configuration of additional search type is then merged with the default one.

```
Somar\Search\PageType\SearchPage:
  searchTypes:
    documents:
      name: Document library
      presets:
        type: documents
      allowEmptyKeyword: true
      labels:
        title: Search publications
      filters:
        topics:
          placeholder: Topics
          field: topics
          multiple: true
          tag: App\Model\Topic
        categories:
          placeholder: Categories
          field: categories
          multiple: true
          tag: App\Model\Category
        regions:
          placeholder: Regions
          field: regions
          multiple: true
          tag: App\Model\Region
        date:
          field: published
```

Index creation
==============

[](#index-creation)

To create the index run `/dev/tasks/Somar-Search-Task-CreateIndexTask`. This task will create the index, set the mapping and create a pipeline for processing attachments.

When the index is created, use `SearchIndexJob` to index the site content (objects of class Page). You can add additional classes to index via .yml config:

```
Somar\Search\Job\SearchIndexJob:
  IndexedClasses:
    - App\Model\Document
```

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance79

Regular maintenance activity

Popularity16

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~196 days

Recently: every ~236 days

Total

11

Last Release

110d ago

PHP version history (2 changes)0.1PHP &gt;=7.1.0

0.4.0PHP &gt;=8.2.0

### Community

Maintainers

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

---

Top Contributors

[![chtombleson](https://avatars.githubusercontent.com/u/276237?v=4)](https://github.com/chtombleson "chtombleson (11 commits)")[![sukhwinder-somar](https://avatars.githubusercontent.com/u/107516681?v=4)](https://github.com/sukhwinder-somar "sukhwinder-somar (10 commits)")[![leochenftw](https://avatars.githubusercontent.com/u/8662044?v=4)](https://github.com/leochenftw "leochenftw (6 commits)")[![jeremysomar](https://avatars.githubusercontent.com/u/54250510?v=4)](https://github.com/jeremysomar "jeremysomar (5 commits)")[![callan-stretton](https://avatars.githubusercontent.com/u/29969836?v=4)](https://github.com/callan-stretton "callan-stretton (2 commits)")[![SophieSomar](https://avatars.githubusercontent.com/u/83376733?v=4)](https://github.com/SophieSomar "SophieSomar (2 commits)")[![oosacker](https://avatars.githubusercontent.com/u/54010582?v=4)](https://github.com/oosacker "oosacker (1 commits)")[![satrun77](https://avatars.githubusercontent.com/u/166450?v=4)](https://github.com/satrun77 "satrun77 (1 commits)")[![carlsomar](https://avatars.githubusercontent.com/u/107008841?v=4)](https://github.com/carlsomar "carlsomar (1 commits)")[![normann](https://avatars.githubusercontent.com/u/556224?v=4)](https://github.com/normann "normann (1 commits)")

---

Tags

searchelasticsearchsilverstripefull text search

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/somardesignstudios-silverstripe-elastic-search/health.svg)

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

###  Alternatives

[mailerlite/laravel-elasticsearch

An easy way to use the official PHP ElasticSearch client in your Laravel applications.

935572.3k2](/packages/mailerlite-laravel-elasticsearch)[matchish/laravel-scout-elasticsearch

Search among multiple models with ElasticSearch and Laravel Scout

7451.7M3](/packages/matchish-laravel-scout-elasticsearch)[jeroen-g/explorer

Next-gen Elasticsearch driver for Laravel Scout.

399654.3k](/packages/jeroen-g-explorer)[heyday/silverstripe-elastica

Provides Elastic Search integration for SilverStripe DataObjects using Elastica

1137.9k2](/packages/heyday-silverstripe-elastica)[blomstra/search

Replaces Flarum search with one powered by an elastic search server.

125.1k](/packages/blomstra-search)

PHPackages © 2026

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