PHPackages                             nicolasbadey/elasticsearch-php-etl - 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. nicolasbadey/elasticsearch-php-etl

ActiveLibrary

nicolasbadey/elasticsearch-php-etl
==================================

Add PHP class to you project for manage ETL, not only for Elasticsearch

v1.0.0(7y ago)041MITPHP

Since Mar 23Pushed 5y ago1 watchersCompare

[ Source](https://github.com/NicolasBadey/elasticsearch-php-etl)[ Packagist](https://packagist.org/packages/nicolasbadey/elasticsearch-php-etl)[ RSS](/packages/nicolasbadey-elasticsearch-php-etl/feed)WikiDiscussions master Synced 2mo ago

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

elasticsearch-php-etl
=====================

[](#elasticsearch-php-etl)

Add PHP class to you project for manage **ETL**, not only for Elasticsearch. This library is design to be use with symfony components or in symfony full stack frameworks, see the symfony section.

For more convenient way, tests are performs in the [symfony-elasticsearch-integration](https://github.com/NicolasBadey/symfony-elasticsearch-integration) repository

What is it ?
------------

[](#what-is-it-)

An ETL (Extract =&gt; Transform =&gt; Load) is used to populate an storage with another source of data and transform the data between the two. Each one of the three classes can be change without impact on the two others, they are uncoupled.

Basic usage here : SQL(ORM) to Elasticsearch

The important things is to see the Transform layer as a denormalizing layer and do not search to put the same structure in Elasticsearch that in SQL.

Install
-------

[](#install)

```
composer require nicolasbadey/elasticsearch-php-etl
```

Usage
-----

[](#usage)

This library is a set of abstract class, interface and one class for help you to create your ETL and focus only on the business code.

For Symfony dependency injection or other dependency injection system you will need a *builder* with only a constructor that extends `AbstractETLBuilder`, he will create a ETL object. You Builder live in your code so in Symfony it will be an autowiring service.

The arguments of your builder will be :

- an Extract that implements `ExtractInterface`
- an Transform that extends `AbstractTransform` or implements `TransformInterface`
- an Load that extends `AbstractElasticSearchLoad` for Elasticsearch or if not Elasticsearch `LoadInterface`

`AbstractElasticSearchLoad` will need a parameters that implements `ElasticsearchClientInterface`Basically a service wrapper of the elasticsearch-php client.

At the end you will do :

```
$ETL::create()->setExtract($extract)
    ->setTransform($transform)
    ->setLoad($load)
    ->run($output);
```

run in ETL class take an Symfony Console components output

You can index a set of ids with `->run($output,false,[42,43,44]);`Second arguments is the `live` flag that allow to index directly in the current user index, see below.

### Live mode

[](#live-mode)

Live mode allow indexing directly in the current index if exists or to create a new index with an alias without wait ETL end's The point is to show content as fast as possible without wait indexation's end.

Basically it's the panic button when ES server has been reset/delete directly in prod (sorry for you). Or, less stressfull, for update index without have a mapping or deletion changes.

### Index one (Subscriber/Listener)

[](#index-one-subscriberlistener)

For index only one documents, you can do it with `run` in live mode and with ids parameter but this method have some advantages :

indexOne don't use Extract layer, so in some conditions like with ORM if you already have the object and your model is not too consumer in lazy loading, it can be an advantage. If index not exists indexOne don't index the object.

```
$ETL::create()->setExtract($extract)
    ->setTransform($transform)
    ->setLoad($load)
    ->indexOne($object);
```

Note that for transform your object, `public function transformObject($object): array;` of your Load class will be call.

The second optional parameter of indexOne allow to force Index creation if not exits :

`->indexOne($object, true) ` for enable it

Technically
-----------

[](#technically)

PagerFanta is used to iterate in ETL class and as a decoupling layer, so according to the interface your Load class will return an PagerFantaAdapter.

You can use Serialiser Components in Transform layer, if you accept to be at least four times slower. I prefer to use basic associative array for an ETL.

Symfony
-------

[](#symfony)

An integration in Symfony is available here : [symfony-elasticsearch-integration](https://github.com/NicolasBadey/symfony-elasticsearch-integration)

- use the Builder with `AbstractETLBuilder`
- use `AbstractETLCommand` for you ETL command ...

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

2607d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6af0595fc577ff8c7091b69d264018c6495bd8aadb1046632f79a839f1556d32?d=identicon)[NicolasBadey](/maintainers/NicolasBadey)

---

Top Contributors

[![NicolasBadey](https://avatars.githubusercontent.com/u/639268?v=4)](https://github.com/NicolasBadey "NicolasBadey (5 commits)")

### Embed Badge

![Health badge](/badges/nicolasbadey-elasticsearch-php-etl/health.svg)

```
[![Health](https://phpackages.com/badges/nicolasbadey-elasticsearch-php-etl/health.svg)](https://phpackages.com/packages/nicolasbadey-elasticsearch-php-etl)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[magento/community-edition

Magento 2 (Open Source)

12.1k52.1k10](/packages/magento-community-edition)[wheelpros/fitment-platform-api

Magento 2 (Open Source)

12.1k1.2k](/packages/wheelpros-fitment-platform-api)[kimai/kimai

Kimai - Time Tracking

4.6k7.4k1](/packages/kimai-kimai)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

81733.7k](/packages/flow-php-flow)[netgen/layouts-core

Netgen Layouts enables you to build and manage complex web pages in a simpler way and with less coding. This is the core of Netgen Layouts, its heart and soul.

3689.4k10](/packages/netgen-layouts-core)

PHPackages © 2026

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