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

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

nordsoftware/lumen-elasticsearch
================================

Simple wrapper of https://github.com/elastic/elasticsearch-php for the Lumen PHP framework.

3.8.2(6y ago)5976.4k1MITPHP &gt;=7.1

Since Nov 26Compare

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

READMEChangelogDependencies (7)Versions (52)Used By (1)

Lumen Elasticsearch
===================

[](#lumen-elasticsearch)

[![Build Status](https://camo.githubusercontent.com/bbce35c1814a5a3324740a436c150a20e18c9c03c20238c82af31e1ab23ff622/68747470733a2f2f7472617669732d63692e6f72672f64696769616f6e6c696e652f6c756d656e2d656c61737469637365617263682e7376673f6272616e63683d6d61696e)](https://travis-ci.org/digiaonline/lumen-elasticsearch)[![Coverage Status](https://camo.githubusercontent.com/35879b39a6eb64543369cfcf168d6611f32683d72425514ce1f61d0f7e7c0d4d/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f64696769616f6e6c696e652f6c756d656e2d656c61737469637365617263682f62616467652e7376673f6272616e63683d6d61696e)](https://coveralls.io/github/digiaonline/lumen-elasticsearch?branch=main)[![Code Climate](https://camo.githubusercontent.com/48eb801b3a91810d6f815a14d1a57361ec3e31dd2c95c7d1dc68fae6888d9f1b/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6e6f7264736f6674776172652f6c756d656e2d656c61737469637365617263682f6261646765732f6770612e737667)](https://codeclimate.com/github/nordsoftware/lumen-elasticsearch)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/4fd0e7eaa39705def12742799d1410fb6aca4773373dd4713fc8751fa92e837c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f64696769616f6e6c696e652f6c756d656e2d656c61737469637365617263682f6261646765732f7175616c6974792d73636f72652e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/digiaonline/lumen-elasticsearch/?branch=main)[![StyleCI](https://camo.githubusercontent.com/f646008e2e75ea8af097a16f3bc1c7d7cc605f89fc2482893b41d49ae445a773/68747470733a2f2f7374796c6563692e696f2f7265706f732f34363933353332342f736869656c643f7374796c653d666c6174)](https://styleci.io/repos/46935324)[![Latest Stable Version](https://camo.githubusercontent.com/97fb2b5a287c497e9862ec6e5c6b566a2efb8b8de0ab029af31edbcfb6f6b048/68747470733a2f2f706f7365722e707567782e6f72672f6e6f7264736f6674776172652f6c756d656e2d656c61737469637365617263682f76657273696f6e)](https://packagist.org/packages/nordsoftware/lumen-elasticsearch)[![Total Downloads](https://camo.githubusercontent.com/175dcdbf5cd4d55abe782d4a9de2de5792a7c535d463085853183bd0029d3714/68747470733a2f2f706f7365722e707567782e6f72672f6e6f7264736f6674776172652f6c756d656e2d656c61737469637365617263682f646f776e6c6f616473)](https://packagist.org/packages/nordsoftware/lumen-elasticsearch)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)

Simple wrapper of [Elasticsearch-PHP](https://github.com/elastic/elasticsearch-php) for the [Lumen PHP framework](http://lumen.laravel.com/).

Version support
---------------

[](#version-support)

LumenElasticsearchPHPLibrary&gt;= 6.05.x&gt;= 7.13.8 - 3.x&gt;= 5.4, &lt;= 6.05.x&gt;= 7.13.0 - 3.75.4.x5.x&gt;= 5.62.x5.4.x2.x&gt;= 5.61.x5.2.x2.x&gt;= 5.60.7.xRequirements
------------

[](#requirements)

- 3.x requires PHP 7.1 or newer
- 2.x requires PHP 5.6 or newer

Usage
-----

[](#usage)

### Installation

[](#installation)

Run the following command to install the package through Composer:

```
composer require nordsoftware/lumen-elasticsearch
```

Copy the configuration template in `config/elasticsearch.php` to your application's `config` directory and modify it to suit your needs.

Add the following line to `bootstrap/app.php`:

```
$app->register(Nord\Lumen\Elasticsearch\ElasticsearchServiceProvider::class);
```

You can now get the service instance using `app(ElasticsearchServiceContract::class)` or inject the `ElasticsearchServiceContract` where needed.

### Configuring your indices

[](#configuring-your-indices)

You can create and delete indices using the provided console commands. Start by adding the commands to your console kernel:

```
protected $commands = [
	...
	CreateCommand::class,
	DeleteCommand::class,
];
```

To create an index you need a configuration file that describes how the index should look. To create an index called `my-index`, create a file named `my-index.php` in the `config/elasticsearch` directory (create the directory if it doesn't exist) with the following contents:

```
