https://github.com/adhocore/plastic
PHP elasticsearch wrapper designed to be minimal, intuitive and dependency free
https://github.com/adhocore/plastic
adhocore elastic-rest elasticsearch php-elasticsearch-wrapper php7 plastic
Last synced: 4 months ago
JSON representation
PHP elasticsearch wrapper designed to be minimal, intuitive and dependency free
- Host: GitHub
- URL: https://github.com/adhocore/plastic
- Owner: adhocore
- License: mit
- Created: 2019-02-09T14:34:47.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2023-05-21T15:28:11.000Z (over 2 years ago)
- Last Synced: 2025-05-15T23:51:07.494Z (5 months ago)
- Topics: adhocore, elastic-rest, elasticsearch, php-elasticsearch-wrapper, php7, plastic
- Language: PHP
- Homepage:
- Size: 14.6 KB
- Stars: 8
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
## adhocore/plastic
PHP elasticsearch wrapper designed to be minimal, intuitive and dependency free.
[](https://github.com/adhocore/plastic/releases)
[](https://travis-ci.com/adhocore/plastic?branch=master)
[](https://scrutinizer-ci.com/g/adhocore/plastic/?branch=master)
[](https://codecov.io/gh/adhocore/plastic)
[](https://styleci.io/repos/169875680)
[](./LICENSE)## Installation
```bash
composer require adhocore/plastic
```## Usage
```php
use Ahc\Plastic\Client;# Instantiate:
$client = new Ahc\Plastic\Client(null, true);# Usage convention:
$client->{$httpMethod}->$segment1->$segment2->$method($data, $query);# For numeric segment or method, prepend with `_`!
# (this is because PHP doesnt allow numeric method or props without some hack)# Example:
$client->post->articles->article->_1(['json_key' => 'value'], ['query' => 'param']);
```See [./test.php](./test.php) for more.
## API
There is none. It works analagous to the RESTful API of [elasticsearch](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs.html).
## Contributing
Please check [the guide](./CONTRIBUTING.md)
## LICENSE
> © [MIT](./LICENSE) | 2019, Jitendra Adhikari