PHPackages                             bfansports/aws-elasticsearch-php-handler - 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. bfansports/aws-elasticsearch-php-handler

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

bfansports/aws-elasticsearch-php-handler
========================================

Small library to access Elasticsearch hosted by AWS.

2.2(2y ago)16.8k4[1 PRs](https://github.com/bfansports/aws-elasticsearch-php-handler/pulls)PHPPHP &gt;=7.0

Since Feb 26Pushed 2mo ago5 watchersCompare

[ Source](https://github.com/bfansports/aws-elasticsearch-php-handler)[ Packagist](https://packagist.org/packages/bfansports/aws-elasticsearch-php-handler)[ RSS](/packages/bfansports-aws-elasticsearch-php-handler/feed)WikiDiscussions master Synced 2d ago

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

aws-elasticsearch-php-handler
=============================

[](#aws-elasticsearch-php-handler)

### PHP Handler to connect to AWS ElasticSearch service.

[](#php-handler-to-connect-to-aws-elasticsearch-service)

#### Installation

[](#installation)

Use composer to install. Simply add `"sportarchive/aws-elasticsearch-php-handler": "dev-master"` to your composer requirements and update.

#### Instructions

[](#instructions)

##### Use basic lucene query syntax to query for results. You can also supply a max count and sort order in the query.

[](#use-basic-lucene-query-syntax-to-query-for-results-you-can-also-supply-a-max-count-and-sort-order-in-the-query)

```
$client = new ElasticsearchHandler(["https://yourawselasticsearchendpoint.aws-region.es.amazonaws.com:443"]);

$ESindex = "index_name";
$EStype = "object_type";
$query = "key:value AND foo:bar";
$count = 12;
$sort = "anotherkey:asc";

$results = $client->raw($ESindex, $query, $count, $sort, $EStype);

```

The count, sort, and type are not required. If they are not supplied, these values will default to:

```
$count = 10;
$sort = "";
$EStype = $ESindex;

```

The `$results` variable will be the raw data returned from the elasticsearch official php library, and includes a variety of metadata.

##### If you only need the source objects that were stored, use the convenience function `query` instead.

[](#if-you-only-need-the-source-objects-that-were-stored-use-the-convenience-function-query-instead)

```
$results = $client->query($ESindex, $query, $count, $sort, $EStype);

```

The `$results` variable will now be an array containing the source objects for your query. Query simply parses the data before returning to make it easier to use.

##### If you wish to simply get the count for the total number of results, there is also a count function.

[](#if-you-wish-to-simply-get-the-count-for-the-total-number-of-results-there-is-also-a-count-function)

```
$client = new ElasticsearchHandler(["https://yourawselasticsearchendpoint.aws-region.es.amazonaws.com:443"]);

$ESindex = "index_name";
$EStype = "object_type";
$query = "key:value AND foo:bar";

$results = $client->raw($ESindex, $query, $EStype);

```

This function acts the same way as `raw` and `query`, but instead uses Elasticsearch's `search_type:count` so it does not actually retrieve or return the data.

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance56

Moderate activity, may be stable

Popularity22

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~291 days

Total

12

Last Release

955d ago

PHP version history (2 changes)2.0PHP &gt;=5.5

2.1PHP &gt;=7.0

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/11eb6c0791d552559e339c66ed3af4f8d5bd6684081603115d8c5967a75278d6?d=identicon)[mhugot](/maintainers/mhugot)

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

---

Top Contributors

[![defmonk0](https://avatars.githubusercontent.com/u/7050495?v=4)](https://github.com/defmonk0 "defmonk0 (38 commits)")[![mhugot](https://avatars.githubusercontent.com/u/3684974?v=4)](https://github.com/mhugot "mhugot (32 commits)")[![emephield](https://avatars.githubusercontent.com/u/5104378?v=4)](https://github.com/emephield "emephield (13 commits)")[![koxon](https://avatars.githubusercontent.com/u/3182882?v=4)](https://github.com/koxon "koxon (7 commits)")

---

Tags

awselasticsearch

### Embed Badge

![Health badge](/badges/bfansports-aws-elasticsearch-php-handler/health.svg)

```
[![Health](https://phpackages.com/badges/bfansports-aws-elasticsearch-php-handler/health.svg)](https://phpackages.com/packages/bfansports-aws-elasticsearch-php-handler)
```

###  Alternatives

[jsq/amazon-es-php

Support for using IAM authentication with the official Elasticsearch PHP client

9310.6M13](/packages/jsq-amazon-es-php)[mailerlite/laravel-elasticsearch

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

934529.3k2](/packages/mailerlite-laravel-elasticsearch)[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)
