Skip to content

v5.2.0

Latest

Choose a tag to compare

@pdphilip pdphilip released this 24 Oct 21:49
· 1 commit to main since this release

This release is compatible with Laravel 10, 11 & 12

New Feature: Query String Queries

This release introduces Query String Queries, bringing full Elasticsearch query_string syntax support directly into your Eloquent-style queries.

  • Method: searchQueryString(query, $fields = null, $options = []) and related methods (orSearchQueryString, searchNotQueryString, etc.)
  • Supports all query_string features — logical operators, wildcards, fuzziness, ranges, regex, boosting, field scoping, and more
  • Includes a dedicated QueryStringOptions class for fluent option configuration or array-based parameters
  • See Tests
  • Full documentation

Example:

Product::searchQueryString('status:(active OR pending) name:(full text search)^2')->get();
Product::searchQueryString('price:[5 TO 19}')->get();

// vanilla optional, +pizza required, -ice forbidden
Product::searchQueryString('vanilla +pizza -ice', function (QueryStringOptions $options) {
    $options->type('cross_fields')->fuzziness(2);
})->get();

//etc

Ordering enhancement: unmapped_type

  • You can now add an unmapped_type flag to your ordering query #88
Product::query()->orderBy('name', 'desc', ['unmapped_type' => 'keyword'])->get();

Bugfix

  • Fixed issue where limit values were being reset on bucket aggregations #84

Full Changelog: v5.1.0...v5.2.0