homersimpsons / es-qb
A query Builder for Elasticsearch
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/homersimpsons/es-qb
Requires
- php: ^7.4
 
Requires (Dev)
- ext-json: *
 - doctrine/coding-standard: ^8.1
 - elasticsearch/elasticsearch: ^7.9
 - phpstan/phpstan: ^0.12.48
 - phpunit/phpunit: ^9.2
 - squizlabs/php_codesniffer: ^3.5
 
This package is auto-updated.
Last update: 2025-10-23 20:23:01 UTC
README
An Elasticsearch Query Builder.
You should choose EsQb if you need the following requirements:
- Strong typing: Ensure your code will work thanks to static analysis
 - Fearless upgrades: Upgrading to a future Elasticsearch version will just require a 
composer update 
Contributing
How to contribute
The current goal is to map every query to specific classes.
When adding a query you need to add its unit test(s) and integration test.
Tests
Unit tests
Unit tests do not need any connection, they are located under tests/Unit directory.
To run this tests please use composer test.
Integration tests
Integration tests do need an active Elasticsearch instance, they are located under tests/Integration directory.
You can create an instance with the following docker command:
docker run -d --name elasticsearch -p 9200:9200 -e "discovery.type=single-node" elasticsearch:7.9.0
Once the instance is running you can run the tests against it with composer test:integration
Inspiration
As a base inspiration there is The official Elasticsearch query builder.