PHPackages                             eos/elasticsearch-5-connector - 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. eos/elasticsearch-5-connector

ActiveLibrary

eos/elasticsearch-5-connector
=============================

An abstract php connector for elasticsearch 5

1.0.0(6y ago)071MITPHPPHP &gt;=7.2

Since Oct 15Pushed 6y ago5 watchersCompare

[ Source](https://github.com/eosnewmedia/Elasticsearch-5-Connector)[ Packagist](https://packagist.org/packages/eos/elasticsearch-5-connector)[ RSS](/packages/eos-elasticsearch-5-connector/feed)WikiDiscussions master Synced today

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

Elasticsearch-5-Connector
=========================

[](#elasticsearch-5-connector)

An abstract php connector for elasticsearch 5.

```
composer require eos/elasticsearch-7-connector
```

How to use?
-----------

[](#how-to-use)

This library provides abstract classes with base functionalities. Your domain classes (e.g. repositories, event handlers or command processors) should extend the `AbstractConnector`or, if you want to use parallel indices, the `AbstractParallelIndexConnector`.

### Method provided by abstract classes

[](#method-provided-by-abstract-classes)

All methods are defined as protected and designed for internal usage in your extending class.

`AbstractConnector`:

MethodDescriptiongetConnection()Returns the current elasticsearch client instance.getIndexName($type)Returns the current index name for the given type.createIndex($type, $overwrite)Creates the given index and all pipelines with the definitions for the given type.dropIndex($type)Drops the given index an all pipelines for the type.storeDocument($type, $id, $data, $parameters)Stores a document, identified by type and id, to the current elasticsearch index. $data has to contain the document sources while $parameters could contain optional parameters for the elasticsearch request.removeDocument($type, $id)Removes a document, identified by type and id, from the current elasticsearch index.executeBulk($force)Executes all bulk actions if forced or bulk size is reached`AbstractParallelIndexConnector`:

MethodDescriptionmigrateToParallelIndex($type, $removeOldIndex)Creates the parallel index, migrates all documents from current index to parallel index, switches the current index to parallel index and then deletes the old index (if remove old index is true)reindexDocumentsToParallelIndex($hits, $type)Bulk index all hits to the parallel index for the given type.### Dependencies

[](#dependencies)

The `AbstractConnector` requires an instance of `ConnectionFactoryInterface` and an instance of `IndexDefinerInterface`(`AbstractParallelIndexConnector` instead requires `ParellelIndexDefinerInterface`).

Optional you can provide a `bulkSize`. If the `bulkSize`, which is 0 by default, is greater then 1, bulk requests with the given bulk size will be executed instead of single requests for each storage operation.

#### ConnectionFactoryInterface

[](#connectionfactoryinterface)

The connection factory is responsible for creating instances of `Elasticsearch\Client`.

The provided implementation of `ConnectionFactoryInterface` is `SimpleConnectionFactory`, which will take a single (!) `dsn` (`scheme://host:port`) as constructor argument.

#### IndexDefinerInterface

[](#indexdefinerinterface)

Index definers provide methods, which contains/creates the elasticsearch definition of a specific index.

An index definer can provide more then one index definition but only one for each type.

Each type will be stored in its own index.

If you want to use one index definer for each type, your index definers could extend `AbstractIndexDefiner` and can be added to an instance of `IndexDefinerRegistry`.

If you want to prefix all your index names with the same base name, you could wrap the `IndexDefinerRegistry` into an instance of `PrefixedIndexDefiner`(its also possible to wrap each single index definer into its own `PrefixedIndexDefiner` or define full index names directly in your index definer).

Docker / Docker Compose
-----------------------

[](#docker--docker-compose)

For local development a docker container with all required components (php, composer) can be created and used:

Build and start the container

```
docker-compose up --build -d
```

Execute a command in the container (here "composer install"):

```
docker-compose exec app sh -c "composer install"
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity54

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

2401d ago

### Community

Maintainers

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

---

Top Contributors

[![pguetschow](https://avatars.githubusercontent.com/u/15265066?v=4)](https://github.com/pguetschow "pguetschow (2 commits)")

### Embed Badge

![Health badge](/badges/eos-elasticsearch-5-connector/health.svg)

```
[![Health](https://phpackages.com/badges/eos-elasticsearch-5-connector/health.svg)](https://phpackages.com/packages/eos-elasticsearch-5-connector)
```

###  Alternatives

[bagisto/bagisto

Bagisto Laravel E-Commerce

26.2k161.6k7](/packages/bagisto-bagisto)[magento/community-edition

Magento 2 (Open Source)

12.1k52.1k10](/packages/magento-community-edition)[mailerlite/laravel-elasticsearch

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

934529.3k2](/packages/mailerlite-laravel-elasticsearch)[wheelpros/fitment-platform-api

Magento 2 (Open Source)

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

UnoPim Laravel PIM

9.4k1.8k](/packages/unopim-unopim)[jeroen-g/explorer

Next-gen Elasticsearch driver for Laravel Scout.

397612.3k](/packages/jeroen-g-explorer)

PHPackages © 2026

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