PHPackages                             soupmix/elasticsearch - 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. [Database &amp; ORM](/categories/database)
4. /
5. soupmix/elasticsearch

AbandonedLibrary[Database &amp; ORM](/categories/database)

soupmix/elasticsearch
=====================

Simple Elasticsearch abstraction layer adapter to handle CRUD operations.

0.9(8y ago)788MIT

Since May 31Compare

[ Source](https://github.com/soupmix/elasticsearch)[ Packagist](https://packagist.org/packages/soupmix/elasticsearch)[ Docs](https://github.com/soupmix/elasticsearch)[ RSS](/packages/soupmix-elasticsearch/feed)WikiDiscussions Synced today

READMEChangelog (10)Dependencies (6)Versions (17)Used By (0)

Soupmix
=======

[](#soupmix)

[![Latest Stable Version](https://camo.githubusercontent.com/413818546580d4d31bc35246109396492eb18b6c28c914e71e1b4be1617fde88/68747470733a2f2f706f7365722e707567782e6f72672f736f75706d69782f656c61737469637365617263682f762f737461626c65)](https://packagist.org/packages/soupmix/elasticsearch) [![Total Downloads](https://camo.githubusercontent.com/f878485bb57efdeaa791876d8e75d1ab0c754816359d7d2184aef715be51fd4c/68747470733a2f2f706f7365722e707567782e6f72672f736f75706d69782f656c61737469637365617263682f646f776e6c6f616473)](https://packagist.org/packages/soupmix/elasticsearch) [![Latest Unstable Version](https://camo.githubusercontent.com/20df717d18fef24a8510aa685d7d7716488fcac67277e3abfcf61796ac24333f/68747470733a2f2f706f7365722e707567782e6f72672f736f75706d69782f656c61737469637365617263682f762f756e737461626c65)](https://packagist.org/packages/soupmix/elasticsearch) [![License](https://camo.githubusercontent.com/e2fbadbed37c62edc3cf94c860576615895201859522f520598f09eeff396325/68747470733a2f2f706f7365722e707567782e6f72672f736f75706d69782f656c61737469637365617263682f6c6963656e7365)](https://packagist.org/packages/soupmix/elasticsearch)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/df7c0224085830dce8a583bbf519554b29c971336d1e1e35b612ceae265ec742/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f736f75706d69782f656c61737469637365617263682f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/soupmix/elasticsearch/) [![Build Status](https://camo.githubusercontent.com/dbf88be6293e48177189916cee60fca2db45a4b0b577df6ef4d0592892d87c27/68747470733a2f2f7472617669732d63692e6f72672f736f75706d69782f656c61737469637365617263682e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/soupmix/elasticsearch) [![Coverage Status](https://camo.githubusercontent.com/f9071588d2fe11a7f721462f5bbbfff20ec45b167a399626558d0feb2864549a/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f736f75706d69782f656c61737469637365617263682f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/soupmix/elasticsearch?branch=master)

Simple ElasticSearch abstraction layer adapter to handle CRUD operations written in PHP. This library does not provide any ORM or ODM.

Installation
------------

[](#installation)

It's recommended that you use [Composer](https://getcomposer.org/) to install Soupmix.

```
$ composer require soupmix/elasticsearch "~0.8"
```

This will install Soupmix and all required dependencies. Soupmix requires PHP 7.1 or newer, [elasticsearch-php](https://github.com/elastic/elasticsearch-php) library or newer for Elasticsearch

Documentation
-------------

[](#documentation)

[API Documentation](https://github.com/soupmix/base/blob/master/docs/API_Documentation.md): See details about the db adapters functions:

Usage
-----

[](#usage)

```

// Connect to Elasticsearch Service
$adapter_config             = [];
$adapter_config['db_name']  = 'indexname';
$adapter_config['hosts']    = ["127.0.0.1:9200"];
$adapter_config['options']  = [];
$config['db_name'] = $adapter_config['db_name];
$client = \Elasticsearch\ClientBuilder::create()->setHosts($adapter_config['hosts'])->build();

$e=new Soupmix\ElasticSearch($config, $client);

$docs = [];
$docs[] = [
    "full_name" => "John Doe",
      "age" => 33,
      "email"    => "johndoe@domain.com",
      "siblings"=> [
        "male"=> [
          "count"=> 1,
          "names"=> ["Jack"]
        ],
        "female"=> [
          "count" => 1,
          "names" =>["Jane"]
        ]
      ]
];
$docs[] = [
    "full_name" => "Jack Doe",
      "age" => 38,
      "email"    => "jackdoe@domain.com",
      "siblings"=> [
        "male"=> [
          "count"=> 1,
          "names"=> ["John"]
        ],
        "female"=> [
          "count" => 1,
          "names" =>["Jane"]
        ]
      ]
];

$docs[] = [
    "full_name" => "Jane Doe",
      "age" => 29,
      "email"    => "janedoe@domain.com",
      "siblings"=> [
        "male"=> [
          "count"=> 2,
          "names"=> ["Jack","John"]
        ],
        "female"=> [
          "count" => 0,
          "names" =>[]
        ]
      ]
];

foreach($docs as $doc){
    // insert user into database
    $es_user_id = $e->insert("users",$doc);

}
// get user data using id
$es_user_data = $e->get('users', "AVPHZO1DY8UxeHDGBhPT");

$filter = ['age_gte'=>0];
// update users' data that has criteria encoded in $filter
$set = ['is_active'=>1,'is_deleted'=>0];

$e->update("users",$)

$filter = ["siblings.male.count__gte"=>2];

//delete users that has criteria encoded in $filter
$e->delete('users', $filter);

// user's age lower_than_and_equal to 34 or greater_than_and_equal 36 but not 38
$filter=[[['age__lte'=>34],['age__gte'=>36]],"age__not"=>38];

//find users that has criteria encoded in $filter
$docs = $e->find("users", $filter);

```

Contribute
----------

[](#contribute)

- Open issue if found bugs or sent pull request.
- Feel free to ask if you have any questions.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity61

Established project with proven stability

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

Recently: every ~144 days

Total

15

Last Release

3071d ago

### Community

Maintainers

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

---

Tags

databaseelasticsearchadaptersAbstraction Layer

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/soupmix-elasticsearch/health.svg)

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

###  Alternatives

[dg/adminer-custom

Customization for Adminer, the best database management tool written in PHP.

134780.5k16](/packages/dg-adminer-custom)[opis/database

A database abstraction layer over PDO, that provides a powerful and intuitive query builder, bundled with an easy to use schema builder

10085.0k3](/packages/opis-database)[designmynight/laravel-elasticsearch

Use Elasticsearch as a database in Laravel to retrieve Eloquent models and perform aggregations.

3041.0k](/packages/designmynight-laravel-elasticsearch)[dg/adminer

Customization for Adminer, the best database management tool written in PHP.

1342.7k](/packages/dg-adminer)

PHPackages © 2026

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