PHPackages                             krisanalfa/ductible - 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. krisanalfa/ductible

ActiveLibrary[API Development](/categories/api)

krisanalfa/ductible
===================

Laravel and ElasticSearch in harmony.

0.0.2(10y ago)015MITPHP

Since Jun 24Pushed 10y agoCompare

[ Source](https://github.com/krisanalfa/ductible)[ Packagist](https://packagist.org/packages/krisanalfa/ductible)[ RSS](/packages/krisanalfa-ductible/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (5)Versions (4)Used By (0)

Ductible
========

[](#ductible)

Ductible is a Laravel package that deliver a mid-level Elastic Search client.

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

[](#installation)

You can install ductible via composer cli:

```
composer install krisanalfa/ductible
```

Configuration
-------------

[](#configuration)

Register `DuctibleServiceProvider` to your configuration:

```
'providers' => [
    // ...

    Zeek\Ductible\DuctibleServiceProvider::class,
],
```

### Optional

[](#optional)

Register Facade alias to your configuration:

```
'aliases' => [
    // ...

    'Ductible' => Zeek\Ductible\Facades\Ductible::class,
],
```

### Publishing Configuration

[](#publishing-configuration)

By default, you can use Ductible with zero configuration, assuming your Elasticsearch run in . If you want something different, you may publish Ductible configuration and make some changes from it:

```
php artisan vendor:publish --provider="Zeek\Ductible\DuctibleServiceProvider"
```

### Configuration Explained

[](#configuration-explained)

You can read from inline docs there. It currently supports many aspect of Elasticsearch client configuration, such as:

- `host` (The most common configuration is telling the client about your cluster. read below to know how to configure multiple hosts.).
- `retries` (When the client runs out of retries, it will throw the last exception that it received.).
- `log` (Where to store your elasticsearch log.).
- `handler` (Elasticsearch-PHP uses an interchangeable HTTP transport layer called RingPHP. You may customize your handler here.).
- `pool` (The connection pool is an object inside the client that is responsible for maintaining the current list of nodes.).
- `selector` (The connection pool manages the connections to your cluster.).
- `serializer` (The response serializer.).
- `client.ignores` (The library attempts to throw exceptions for common problems. These exceptions match the HTTP response code provided by Elasticsearch.)
- `client.verbose` (If you require more information, you can tell the client to return a more verbose response.).

You can set multiple hosts by configuring in your `env` file like so:

```
ELASTICSEARCH_HOSTS="localhost:9200|192.168.1.10:9200|http://myserver.com:9200"

```

Usage
-----

[](#usage)

### Basic

[](#basic)

Ductible provides a low level client interaction, which you can explore as much as you want.

#### Indexing a Document

[](#indexing-a-document)

```
$result = Ductible::index([
    'index' => 'myIndex',
    'type' => 'myType',
    'id' => 1,
    'body' => [
        'fieldFoo' => 'Foo',
        'fieldBar' => 'Bar',
        'fieldBaz' => 'Baz',
    ],
]);
```

#### Getting Document Index

[](#getting-document-index)

```
$index = Ductible::get([
    'index' => 'myIndex',
    'type' => 'type',
    'id' => 1,
]); // The result is an array
```

#### Update Document Index

[](#update-document-index)

```
$result = Ductible::index([
    'index' => 'myIndex',
    'type' => 'myType',
    'id' => 1,
    'body' => [
        'fieldFoo' => 'Foo Foo',
        'fieldBar' => 'Bar Bar',
        'fieldBaz' => 'Baz Baz',
    ],
]);
```

#### Delete Document Index

[](#delete-document-index)

```
$index = Ductible::delete([
    'index' => 'myIndex',
    'type' => 'type',
    'id' => 1,
]); // The result is an array
```

#### Searching

[](#searching)

```
$result = Ductible::search($searchParams);
```

#### Bulk Indexing Documents

[](#bulk-indexing-documents)

```
$result = Ductible::bulk($searchParams);
```

### Using Eloquent

[](#using-eloquent)

**To Be Defined**

### ToDo

[](#todo)

- Separate indexing operation based on eloquent model in Ductible main class
- More unit testing

###  Health Score

24

—

LowBetter than 30% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity55

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

Total

2

Last Release

3702d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5585ab7e83e92b16ebfde64d7d90ff330721bcb1fbfa193fb0ffe149a4b3a7d1?d=identicon)[krisanalfa](/maintainers/krisanalfa)

---

Top Contributors

[![krisanalfa](https://avatars.githubusercontent.com/u/3734729?v=4)](https://github.com/krisanalfa "krisanalfa (6 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/krisanalfa-ductible/health.svg)

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

###  Alternatives

[sylius/sylius

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

8.5k6.0M776](/packages/sylius-sylius)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k18.3M418](/packages/easycorp-easyadmin-bundle)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

86337.5k](/packages/flow-php-flow)[unopim/unopim

UnoPim Laravel PIM

10.8k2.5k](/packages/unopim-unopim)[flat3/lodata

OData v4.01 Producer for Laravel

99357.6k](/packages/flat3-lodata)[pagemachine/searchable

TYPO3 extension to index and search content with Elasticsearch

1140.6k](/packages/pagemachine-searchable)

PHPackages © 2026

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