Skip to content

What's New in V3

V3 represents a near-complete rewrite of the Laravel-Opensearch package. This update delivers a more seamless integration with Laravel’s Models, Eloquent, and Query Builders while providing greater access to OpenSearch’s advanced features.

  • Ids can be generated on the Laravel side by using the GeneratesUuids or the GeneratesElasticIds trait. Docs
  • Field Maps can be defined in the model to map text to keyword fields, boosting performance Docs
  • All clauses in the query builder now accept an optional callback of OpenSearch options to be applied to the clause. Docs
  • BelongsToMany relationships are now supported. Docs

Three powerful new query methods have been added to simplify expressive search:

  • Stats Aggregations Docs
  • Extended Stats Aggregations - Docs
  • Cardinality Aggregations - Docs
  • Median Absolute Deviation Aggregations - Docs
  • Percentiles Aggregations - Docs
  • Normalizers can now be defined in migrations. Docs

For low-level operations, you can access the native OpenSearch PHP client directly:

Connection::on('opensearch')->openClient()->{clientMethod}();

This release is a complete architectural overhaul designed to mirror Laravel’s Eloquent ORM more closely.
The internals have been refactored for better testability, performance, and future extensibility.

Diagram