Search by

obj63mc / silverstripe-forager-elasticsearch

obj63mc

Elasticsearch provider for silverstripe/silverstripe-forager, using the official Elasticsearch PHP client.

Package info

github.com/obj63mc/silverstripe-forager-elasticsearch

Type:silverstripe-vendormodule

pkg:composer/obj63mc/silverstripe-forager-elasticsearch

Statistics

Installs: 5

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

0.1.0 2026-10-08 21:51 UTC

This package is auto-updated.

Last update: 2026-10-08 21:55:06 UTC


README

An Elasticsearch provider for silverstripe/silverstripe-forager, built on the official Elasticsearch PHP client.

It replaces silverstripe-forager-elastic-enterprise, whose App Search / Enterprise Search backend has been retired by Elastic, and talks to plain Elasticsearch indexes instead. It works with Elastic Cloud (hosted and serverless) and self-managed clusters.

Requirements

  • PHP ^8.3
  • Silverstripe ^6
  • silverstripe/silverstripe-forager ^2
  • elasticsearch/elasticsearch ^9.2

Forager and the Elasticsearch client are installed with this module.

Installation

composer require obj63mc/silverstripe-forager-elasticsearch

Add the endpoint and an API key which can manage and write to your indexes to the environment:

ELASTICSEARCH_ENDPOINT="https://my-project.es.eu-central-1.aws.elastic.cloud:443"
ELASTICSEARCH_APIKEY="..."

The module only registers itself as the Forager indexing service when ELASTICSEARCH_ENDPOINT is set, so environments without it keep Forager's default (which does nothing).

Quick start

  1. Describe your indexes with the usual Forager configuration:

    SilverStripe\Forager\Service\IndexConfiguration:
      indexes:
        main:
          includeClasses:
            Page:
              fields:
                title: true
                content: true
                summary:
                  property: MetaDescription
                published:
                  property: LastEdited
                  options:
                    type: date
  2. Flush, then create the indexes and their mappings:

    vendor/bin/sake tasks:SearchConfigure --flush
  3. Index your content, and run the queued jobs:

    vendor/bin/sake tasks:SearchReindex
    vendor/bin/sake tasks:ProcessJobQueueTask

After that, records are added and removed as they are published and unpublished.

Documentation

  • Configuration: index names, field types, analyzers, changing a mapping
  • Fluent: one index per locale with silverstripe-forager-fluent
  • Searching: querying the indexes, and content which is not public

See the Forager documentation for everything which is not specific to Elasticsearch.

License

MIT, see LICENSE.