PHPackages                             eos/elasticsearch-7-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. [API Development](/categories/api)
4. /
5. eos/elasticsearch-7-connector

ActiveLibrary[API Development](/categories/api)

eos/elasticsearch-7-connector
=============================

An abstract php connector for elasticsearch 7

1.2.1(6y ago)02.2kMITPHPPHP &gt;=7.2

Since Dec 3Pushed 6y ago5 watchersCompare

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

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

Elasticsearch-7-Connector
=========================

[](#elasticsearch-7-connector)

An abstract php connector for elasticsearch 7.

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

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community9

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

Every ~8 days

Total

9

Last Release

2291d ago

### Community

Maintainers

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

---

Top Contributors

[![bogomolov-dev](https://avatars.githubusercontent.com/u/127733?v=4)](https://github.com/bogomolov-dev "bogomolov-dev (1 commits)")

### Embed Badge

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

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

###  Alternatives

[sylius/sylius

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

8.4k5.6M651](/packages/sylius-sylius)[algolia/algoliasearch-client-php

API powering the features of Algolia.

69333.0M114](/packages/algolia-algoliasearch-client-php)[wheelpros/fitment-platform-api

Magento 2 (Open Source)

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

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

517.9M7](/packages/avalara-avataxclient)[alexacrm/dynamics-webapi-toolkit

Web API toolkit for Microsoft Dynamics 365 and Dynamics CRM

81324.1k1](/packages/alexacrm-dynamics-webapi-toolkit)

PHPackages © 2026

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