PHPackages                             byng/pimcore-elasticsearch-plugin - 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. byng/pimcore-elasticsearch-plugin

ActivePimcore-plugin[Search &amp; Filtering](/categories/search)

byng/pimcore-elasticsearch-plugin
=================================

Elasticsearch Pimcore plugin

v4.1.1(8y ago)81.3k9[2 issues](https://github.com/byng-systems/pimcore-elastic-search-plugin/issues)MITPHPPHP &gt;=5.4

Since Feb 17Pushed 7y ago11 watchersCompare

[ Source](https://github.com/byng-systems/pimcore-elastic-search-plugin)[ Packagist](https://packagist.org/packages/byng/pimcore-elasticsearch-plugin)[ Docs](https://github.com/byng-systems/pimcore-elastic-search-plugin)[ RSS](/packages/byng-pimcore-elasticsearch-plugin/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (10)Dependencies (3)Versions (40)Used By (0)

Pimcore Elasticsearch Plugin
============================

[](#pimcore-elasticsearch-plugin)

The Elasticsearch plugin for Pimcore Saves/updates contents (text only) of document's (editables) and assets to Elasticsearch. It also provides a query builder to search the index.

Features
--------

[](#features)

- Automatic indexing of documents and assets to Elasticsearch when created/updated in Pimcore admin.
- Hooks to add custom properties to the index.
- A simple query builder to retrieve indexed documents. Supports querying, filtering, sorting and pagination.

System Requirements
-------------------

[](#system-requirements)

- PHP - 5.6+
- Elasticsearch - 1.7+
- Pimcore - 3, 4 (not tested on 5 yet)

Installation via composer
-------------------------

[](#installation-via-composer)

The recommended method to install the Pimcore Elasticsearch Plugin is via [Composer](https://getcomposer.org/).

1 - Add [`byng/pimcore-elasticsearch-plugin`](https://packagist.org/packages/byng/pimcore-elasticsearch-plugin) as a dependency in your project's composer.json file and run `composer install`

2 - Copy the distribution config file (`elasticsearchplugin.xml.dist`) in the root of the plugin folder to `{PIMCORE_WEBSITE_DIR}/var/config/elasticsearchplugin.xml`.

3 - Enable the plugin in Pimcore using the extension manager.

Quickstart
----------

[](#quickstart)

Once the installation has been completed, the first time you create or update a document the Elasticsearch index will be created and the document will be indexed. You can verify that the index exists using curl or [Kibana](https://www.elastic.co/products/kibana).

Hooks
-----

[](#hooks)

Hooks allow you to hook into the plugin at various points to provide additional functionality. It uses the standard Zend EventManager which Pimcore uses.

### Registering an event listener example

[](#registering-an-event-listener-example)

For example to register an even listener:

```
// @var $eventManager Zend_EventManager_EventManager
$eventManager->attach(
    "document.elasticsearch.preIndex",
    [__CLASS__, "handlePreIndex"]
);
```

The above code will call the `handlePreIndex()` method of the class where it was added whenever a document is ready to be indexed.

Within the `handlePreIndex()` method you have access to the actual Pimcore document which is being indexed and also the data the plugin has lready extracted. You can add additional properties to the parameters array and they will also be saved to the index:

```
public static function handlePreIndex(ZendEvent $event)
{
    /** @var Page $document */
    $document = $event->getTarget();
    $params = $event->getParams();

    $params["body"]["page"]["customProperty"] = "something";
}
```

Available hooks
---------------

[](#available-hooks)

The following hooks are currently available:

### document.elasticsearch.preIndex

[](#documentelasticsearchpreindex)

This hook is called after the plugin has extracted all the information from the document to index and before it writes the data to Elasticsearch. You can use this hook to write additional/custom properties to the index.

### asset.elasticsearch.preIndex

[](#assetelasticsearchpreindex)

This hook is the asset equivalent of "document.elasticsearch.preIndex".

Querying
--------

[](#querying)

The pluigin provides a simple query builder to make it easy to extract information from Elasticsearch.

### Example

[](#example)

```
use Byng\Pimcore\Elasticsearch\Query\BoolQuery;
use Byng\Pimcore\Elasticsearch\Query\MatchQuery;
use Byng\Pimcore\Elasticsearch\Query\Query;
use Byng\Pimcore\Elasticsearch\Query\QueryBuilder;
use Byng\Pimcore\Elasticsearch\Gateway\PageGateway;

$boolQuery = new BoolQuery();
$boolQuery->addMust(new MatchQuery("_all", "something"));

$query = new Query($boolQuery);

$queryBuilder = new QueryBuilder();
$queryBuilder->setQuery($query);
$queryBuilder->setSize(10); // number of results to return

$pageGateway = PageGateway::getInstance();
$resultSet =  $pageGateway->query($queryBuilder);
```

The following JSON request will be generated from the above code and sent to Elasticsearch:

```
{
    "query": {
        "bool": {
            "must": [
                {
                    "match": {
                        "_all": "something"
                    }
                }
            ]
        }
    },
    "size": 10
}
```

This will retrieve all documents that contain the word "something".

### Todo

[](#todo)

- Provide more complete query documentation
- Add support for custom queries, i.e. an array which can be converted to json and posted to Elasticsearch without any processing if the plugin doesn't support the whole Elasticsearch DSL for querying.

License
-------

[](#license)

MIT

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity70

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

Recently: every ~64 days

Total

36

Last Release

2912d ago

Major Versions

1.0.x-dev → 2.1.02016-06-07

2.4.x-dev → 3.0.02016-06-28

1.1.x-dev → v3.2.12016-10-16

v3.4.0 → v4.0.02017-10-25

PHP version history (2 changes)2.0.x-devPHP &gt;=5.4

1.0.0PHP &gt;=5.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2078024?v=4)[Byng](/maintainers/byng)[@byng](https://github.com/byng)

---

Top Contributors

[![seeruk](https://avatars.githubusercontent.com/u/2083033?v=4)](https://github.com/seeruk "seeruk (38 commits)")[![mdjward](https://avatars.githubusercontent.com/u/4046455?v=4)](https://github.com/mdjward "mdjward (35 commits)")[![asim-inviqa](https://avatars.githubusercontent.com/u/3263933?v=4)](https://github.com/asim-inviqa "asim-inviqa (24 commits)")[![asimlqt](https://avatars.githubusercontent.com/u/1963846?v=4)](https://github.com/asimlqt "asimlqt (24 commits)")[![mmaszkiewicz](https://avatars.githubusercontent.com/u/2112761?v=4)](https://github.com/mmaszkiewicz "mmaszkiewicz (10 commits)")[![IoannisByng](https://avatars.githubusercontent.com/u/13465278?v=4)](https://github.com/IoannisByng "IoannisByng (4 commits)")[![david-byng](https://avatars.githubusercontent.com/u/7117171?v=4)](https://github.com/david-byng "david-byng (2 commits)")[![cj123](https://avatars.githubusercontent.com/u/306873?v=4)](https://github.com/cj123 "cj123 (2 commits)")[![kkarkus](https://avatars.githubusercontent.com/u/17312072?v=4)](https://github.com/kkarkus "kkarkus (1 commits)")

---

Tags

pluginelasticsearchpimcore

### Embed Badge

![Health badge](/badges/byng-pimcore-elasticsearch-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/byng-pimcore-elasticsearch-plugin/health.svg)](https://phpackages.com/packages/byng-pimcore-elasticsearch-plugin)
```

###  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)[10up/elasticpress

Supercharge WordPress with Elasticsearch.

1.3k387.2k14](/packages/10up-elasticpress)[jeroen-g/explorer

Next-gen Elasticsearch driver for Laravel Scout.

399654.3k](/packages/jeroen-g-explorer)[10up/debug-bar-elasticpress

Extends the Debug Bar plugin for usage with ElasticPress

2817.3k](/packages/10up-debug-bar-elasticpress)[heyday/silverstripe-elastica

Provides Elastic Search integration for SilverStripe DataObjects using Elastica

1137.9k2](/packages/heyday-silverstripe-elastica)

PHPackages © 2026

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