Introducing Elasticsearch repository php package
Mustafa Hussain
Posted on December 30, 2017
Elasticsearch active repository package
Elasticsearch Repository is a simple, smart implementation of Active Repository for Elasticsearch.
Features
- provide active repository pattern over your elasticsearch indices, types.
- Minimize lines of code for building elasticsearch queries with system with big business logic.
- Prevent code duplication.
- Reduce potential programming errors.
- Apply centrally managed, consistent access rules and logic.
- Improve the code’s maintainability and readability by separating client objects from domain models.
- Maximize the amount of code that can be tested with automation and to isolate both the client object and the domain model to support unit testing.
installation
grap it via composer
composer require mustafah15/elastic-repository
ElasticRepository contains a queryBuilder object for getting result from elasticsearch in effective way example for using queryBuilder inside your repository
public function getStudent($name, $class) {
$this->queryBuilder->match('name', $name)->where('class', $class)->get();
}
For full documentation check github repository
💖 💪 🙅 🚩
Mustafa Hussain
Posted on December 30, 2017
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.