Download the PHP package nicolasbadey/elasticsearch-php-etl without Composer

On this page you can find all versions of the php package nicolasbadey/elasticsearch-php-etl. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package 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 repository

What is it ?

An ETL (Extract => Transform => 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

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 :

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

At the end you will do :

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

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.

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

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

An integration in Symfony is available here : symfony-elasticsearch-integration


All versions of elasticsearch-php-etl with dependencies

PHP Build Version
Package Version
Requires elasticsearch/elasticsearch Version ~6.1
symfony/console Version ~4.0
pagerfanta/pagerfanta Version ~2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package nicolasbadey/elasticsearch-php-etl contains the following files

Loading the files please wait ...