PHPackages                             ienaga/simple-elasticsearch-client - 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. [Search &amp; Filtering](/categories/search)
4. /
5. ienaga/simple-elasticsearch-client

ActiveLibrary[Search &amp; Filtering](/categories/search)

ienaga/simple-elasticsearch-client
==================================

Simple ElasticSearch Library.

1.0.0(8y ago)05.4kMITPHPCI failing

Since Jun 1Pushed 6y ago2 watchersCompare

[ Source](https://github.com/ienaga/SimpleElasticSearchClient)[ Packagist](https://packagist.org/packages/ienaga/simple-elasticsearch-client)[ Docs](https://github.com/ienaga/SimpleElasticSearchClient)[ RSS](/packages/ienaga-simple-elasticsearch-client/feed)WikiDiscussions master Synced 4w ago

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

SimpleElasticSearchClient
=========================

[](#simpleelasticsearchclient)

ElasticSearch Simple Library for PHP

ElasticSearch Version
=====================

[](#elasticsearch-version)

- 2.3.x
- 5.1.x

[![Build Status](https://camo.githubusercontent.com/8d72d6d92333c292d8c598d929449b857794d9bce0c70b8f737b438ceb55c13c/68747470733a2f2f7472617669732d63692e6f72672f69656e6167612f53696d706c65456c6173746963536561726368436c69656e742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ienaga/SimpleElasticSearchClient)

[![Latest Stable Version](https://camo.githubusercontent.com/086db92f2db51d994de9613caca4739a6d1ff910d217e2dc7429642a434c0a46/68747470733a2f2f706f7365722e707567782e6f72672f69656e6167612f73696d706c652d656c61737469637365617263682d636c69656e742f762f737461626c65)](https://packagist.org/packages/ienaga/simple-elasticsearch-client) [![Total Downloads](https://camo.githubusercontent.com/cea19bd59f4aa18676118c00a1197662a804dbeeff46dfba6d1b456d2b2863e4/68747470733a2f2f706f7365722e707567782e6f72672f69656e6167612f73696d706c652d656c61737469637365617263682d636c69656e742f646f776e6c6f616473)](https://packagist.org/packages/ienaga/simple-elasticsearch-client) [![Latest Unstable Version](https://camo.githubusercontent.com/2bb3542be11059f8231836ed65dc030759ec8aa5744cd04476732970696b0920/68747470733a2f2f706f7365722e707567782e6f72672f69656e6167612f73696d706c652d656c61737469637365617263682d636c69656e742f762f756e737461626c65)](https://packagist.org/packages/ienaga/simple-elasticsearch-client) [![License](https://camo.githubusercontent.com/c2a473ae5efea01e27028ac0318b4019786ca7de40b5fe418717670e4e3cbbf7/68747470733a2f2f706f7365722e707567782e6f72672f69656e6167612f73696d706c652d656c61737469637365617263682d636c69656e742f6c6963656e7365)](https://packagist.org/packages/ienaga/simple-elasticsearch-client)

Search
======

[](#search)

Case - 1
--------

[](#case---1)

```
SELECT * FROM `INDEX_NAME`.`TYPE_NAME` WHERE `statue` = 1;
```

```
use \SimpleElasticSearch\Client;

$client = new new Client([
    "end_point" => "URL"
]);

$result = $client
    ->setIndex("INDEX_NAME")
    ->setType("TYPE_NAME")
    ->createFilter() // filter search start
    ->addAnd("status", $status)
    ->attach() // filter search end
    ->search(); // execute search
```

Case - 2
--------

[](#case---2)

```
SELECT * FROM `INDEX_NAME`.`TYPE_NAME` WHERE (`user_id` = 1 OR `user_id` = 2);
```

```
use \SimpleElasticSearch\Client;

$client = new new Client([
    "end_point" => "URL"
]);

$result = $client
    ->setIndex("INDEX_NAME")
    ->setType("TYPE_NAME")
    ->createFilter() // filter search start
    ->addOr("user_id", 1)
    ->addOr("user_id", 2)
    ->attach() // filter search end
    ->search(); // execute search
```

Case - 3
--------

[](#case---3)

```
SELECT * FROM `INDEX_NAME`.`TYPE_NAME` WHERE `status` != 0;
```

```
use \SimpleElasticSearch\Client;

$client = new new Client([
    "end_point" => "URL"
]);

$result = $client
    ->setIndex("INDEX_NAME")
    ->setType("TYPE_NAME")
    ->createFilter() // filter search start
    ->addNot("status", 0)
    ->attach() // filter search end
    ->search(); // execute search
```

Case - 4
--------

[](#case---4)

```
SELECT * FROM `INDEX_NAME`.`TYPE_NAME` WHERE `status` BETWEEN 0 AND 100;
```

```
use \SimpleElasticSearch\Client;

$client = new new Client([
    "end_point" => "URL"
]);

$result = $client
    ->setIndex("INDEX_NAME")
    ->setType("TYPE_NAME")
    ->createFilter() // filter search start
    ->between("status", 0, 100)
    ->attach() // filter search end
    ->search(); // execute search
```

Case - 5
--------

[](#case---5)

```
SELECT * FROM `INDEX_NAME`.`TYPE_NAME` WHERE `status` > 100;
```

```
use \SimpleElasticSearch\Client;

$client = new new Client([
    "end_point" => "URL"
]);

$result = $client
    ->setIndex("INDEX_NAME")
    ->setType("TYPE_NAME")
    ->createFilter() // filter search start
    ->operator("status", 100, "gt")
    ->attach() // filter search end
    ->search(); // execute search
```

Result
======

[](#result)

```
use \SimpleElasticSearch\Client;

$client = new new Client([
    "end_point" => "URL"
]);

$result = $client
    ->setIndex("index name")
    ->setType("type name")
    ->createFilter() // filter search start
    ->addAnd("status", $status) // match case
    ->setFrom($offset) // offset
    ->setSize($limit) // limit
    ->addSort("price", $sort) // sort
    ->setAggregation("user_id") // group by
    ->attach() // filter search end
    ->search(); // execute search

// found
if ($result->isFound()) {
    // ArrayAccess, Iterator, Countable
    foreach ($result as $hit) {
        // Result Singular
        // $hit->getIndex();
        // $hit->getType();
        // $hit->getId();
        // $hit->property;
    }
}
```

Data Create
===========

[](#data-create)

```
use \SimpleElasticSearch\Client;

$client = new new Client([
    "end_point" => "URL"
]);

$query = [
    "status"  => 0,
    "price"   => 100,
    "user_id" => 1,
];

$client
    ->setIndex("index name")
    ->setType("type name")
    ->setBody($query)
    ->create();
```

Data Update Plural
==================

[](#data-update-plural)

```
use \SimpleElasticSearch\Client;

$client = new new \SimpleElasticSearch\Client([
    "end_point" => "URL"
]);

$result = $client
    ->setIndex("index name")
    ->setType("type name")
    ->createFilter()
    ->addAnd("user_id", $userId)
    ->attach()
    ->search();

if ($result->isFound()) {
    foreach ($result as $hit) {

        $hit->status = 1;

        $client
            ->setIndex("index name")
            ->setType("type name")
            ->setId($hit["_id"])
            ->setBody($hit->getSource())
            ->update();
    }
}
```

Data Update Singular
====================

[](#data-update-singular)

```
use \SimpleElasticSearch\Client;

$client = new new \SimpleElasticSearch\Client([
    "end_point" => "URL"
]);

$result = $client
    ->setIndex("index name")
    ->setType("type name")
    ->setId("id name")
    ->get();

if ($result->isFound()) {
    $result->status = 1;

    $client
        ->setIndex($result->getIndex())
        ->setType($result->getType())
        ->setId($result->getId())
        ->setBody($result->getSource())
        ->update();
}
```

Data Delete
===========

[](#data-delete)

```
use \SimpleElasticSearch\Client;

$client = new new \SimpleElasticSearch\Client([
    "end_point" => "URL"
]);

$client
    ->setIndex("index name")
    ->setType("type name")
    ->setId("id name")
    ->delete();
```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

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

2951d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4123454?v=4)[Toshiyuki Ienaga](/maintainers/ienaga)[@ienaga](https://github.com/ienaga)

---

Top Contributors

[![thomas-sonicmoov](https://avatars.githubusercontent.com/u/84434672?v=4)](https://github.com/thomas-sonicmoov "thomas-sonicmoov (114 commits)")[![ienaga](https://avatars.githubusercontent.com/u/4123454?v=4)](https://github.com/ienaga "ienaga (2 commits)")[![minatosonic](https://avatars.githubusercontent.com/u/29032194?v=4)](https://github.com/minatosonic "minatosonic (1 commits)")

---

Tags

elasticsearchphpawselasticsearchlibrary

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ienaga-simple-elasticsearch-client/health.svg)

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

###  Alternatives

[jsq/amazon-es-php

Support for using IAM authentication with the official Elasticsearch PHP client

9211.2M13](/packages/jsq-amazon-es-php)[smile/module-elasticsuite-cms-search

Smile Elasticsuite - Cms Pages Search Module for Smile Elasticsuite.

25949.3k1](/packages/smile-module-elasticsuite-cms-search)

PHPackages © 2026

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