Download the PHP package ponito/elastico without Composer
On this page you can find all versions of the php package ponito/elastico. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ponito/elastico
More information about ponito/elastico
Files in ponito/elastico
Package elastico
Short Description Elasticsearch Eloquent ORM for Laravel: models, query builder, aggregations, ILM and scripted updates on Elasticsearch 8
License MIT
Homepage https://github.com/ponito-dev/elastico
Informations about the package elastico
Elastico
Elasticsearch Eloquent ORM for Laravel. Extends Laravel's database layer so you can use Eloquent models, the query builder, aggregations, ILM policies, and scripted updates against Elasticsearch indices — with the same patterns you already know.
Elastico is extracted from and runs in production at Ponito, a Swiss price comparison service, where it backs the product catalogue, faceted search, crawler queues and affiliate feed imports on an Elasticsearch 8 cluster.
Requirements
- PHP 8.2+
- Laravel 11 or 12
- Elasticsearch 8.x
Installation
Configuration
Add a connection to config/database.php:
Eloquent Models
Defining a model
Creating and managing the index
Basic CRUD
Query Builder
All standard Laravel builder methods work. Elastico adds ES-specific operators:
Filtering
Full-text / like
Sorting
Pagination and limits
Field selection
Collapse
Suggest
KNN (vector search)
Runtime fields
Cursor (point-in-time scrolling)
Multi-search
Counts and scalars
Compiled query
Aggregations
Aggregations are added to the builder and accessed via the response collection.
Metric aggregations
Bucket aggregations
Nested aggregations
Scripted updates
Update documents with Painless scripts instead of setting values directly.
Increment a field
Custom Painless script
Post-filter
Post-filter applies after aggregations are computed — useful for filtering results without affecting bucket counts:
Index Lifecycle Management (ILM)
Relations
Elastico supports both Elasticsearch-native relations and hybrid relations to standard SQL models.
Testing
The test suite is split into three layers:
| Suite | What it tests | Needs ES? |
|---|---|---|
| Unit | DSL query and aggregation compilation | No |
| Feature | Grammar compilation (builder → ES payload) | No |
| Integration | Actual queries against a live index | Yes |
Integration tests skip automatically with a clear message when Elasticsearch is not reachable. Configure the host via ELASTICSEARCH_HOST env var (defaults to http://localhost:9200).
All versions of elastico with dependencies
illuminate/collections Version ^11.0|^12.0
illuminate/support Version ^11.0|^12.0
php-http/guzzle7-adapter Version ^1.0
elasticsearch/elasticsearch Version ^8.2
spatie/laravel-data Version ^4.6
illuminate/database Version ^11.0|^12.0
filament/filament Version ^4.0