hungneox / ramen-elastic-query
Lumen/Laravel package for interacting with elasticsearch
dev-master
2018-01-21 18:43 UTC
Requires
- illuminate/console: ^5.5
- illuminate/http: ^5.5
- illuminate/support: v5.5.17
- nordsoftware/lumen-elasticsearch: ^2.3.6
Requires (Dev)
- phpunit/phpunit: ^5.7
This package is not auto-updated.
Last update: 2025-09-06 21:03:28 UTC
README
Fluent Pseudo-SQL query builder for Elasticsearch built on top of Lumen Elasticsearch
Installation
Run the following command to install the package through Composer:
composer require hungneox/ramen-elastic-query
Add the following line to bootstrap/app.php:
$app->register(Neox\Ramen\Elastic\ElasticQueryServiceProvider::class);
Usage
Simple select
Object initiation or Facade both work
$builder = app(Builder::class);
$result = $builder
->use('content') // collection
->from('article') // type
->find('TIYKtQX', '_id', ['id', 'title', 'description']);
$result = ES::use('content')
->from('article')
->find('TIYKtQX', '_id', ['id', 'title', 'description']);
Normal where clause
$result = $builder->select('id', 'description')
->from('recipe')
->where('_id', '=', $id)
->get();
Fulltext match
$result = $builder
->use('content')
->select('id', 'title', 'description', 'featured')
->from('article')
->where('title', 'like', 'Auringonkukan')
->orderBy('featured', 'desc')
->get();
Deletion
ES::use('content')->from('article')->delete($id);
License
See LICENSE.