Skip to content

Releases: matchory/elasticsearch

Version 2.6.1

16 Sep 10:31
91a9d38

Choose a tag to compare

Changelog

  • Fix: Using unselect() to exclude fields before any were included using select(), an error would occur (#84)
  • Fix: select() would add fields to the legacy key _source.include instead of _source.includes

Version 2.6.0

16 Sep 10:00
de3e616

Choose a tag to compare

Changelog

  • Feature: Added aggregate() method to query builder, allowing to fluently add aggregations.
  • Chore: Updated dependencies

Adding aggregations

From 2.6.0 onwards, you can add aggregations to your query using the fluent query builder:

$query->aggregate('color');

Specifying the name only will create a simple term query:

{
    "aggs": {
        "color": {
            "terms": {
                "field": "color"
            }
    }
}

Pass a string to use a different field:

$query->aggregate('color', 'color_field');

Specifying the name only will create a simple term query:

{
    "aggs": {
        "color": {
            "terms": {
                "field": "color_field"
            }
    }
}

To have custom aggregations, pass an array instead of the field name:

$query->aggregate('date', [
    'date_histogram' => [
        'field' => 'date',
        'interval' => 'month'
    ]
]);

Specifying the name only will create a simple term query:

{
    "aggs": {
        "date": {
            "date_histogram": {
                "field": "date",
                "interval": "month"
            }
        }
    }
}

Version 2.5.2

13 Jun 09:40
3a47683

Choose a tag to compare

Changelog

  • Regression: Library would not work with Lumen due to a hard-coded Laravel dependency (#47)

Version 2.5.2 (Beta 1)

13 Jun 09:37
3a47683

Choose a tag to compare

Pre-release

Changelog

  • Regression: Library would not work with Lumen due to a hard-coded Laravel dependency (#47)

Version 2.5.1

26 Apr 10:50
f6a56d4

Choose a tag to compare

Change log

  • Fix: When calling map() on a Collection and calling toArray() afterwards, an exception would be thrown if the collection wasn't mapped to arrays due to a faulty return type declaration. (fixed in #32, thanks @matthenning)

Version 2.5.0

22 Apr 14:04
a7f7f1b

Choose a tag to compare

Change log

  • Feature: Added support for filter shorthand methods to add filters to the query directly
  • Feature: Allowed to use filter, must and must_not with their counterparts from a custom body by merging them
  • Feature: Added possibility to use literal comparison operators (eq, gte, etc.) in addition to standard operators
  • Fix: Improved URL resolution for pagination by using Laravel's request facade
  • Fix: Added IDE autocompletion to pagination instances by adding a mixin annotation to Collection

Version 2.5.0 (Beta 1)

22 Apr 12:21
1d1ff6f

Choose a tag to compare

Pre-release

Change log

  • Feature: Added support for filter shorthand methods to add filters to the query directly
  • Feature: Allowed to use filter, must and must_not with their counterparts from a custom body by merging them
  • Feature: Added possibility to use literal comparison operators (eq, gte, etc.) in addition to standard operators
  • Fix: Improved URL resolution for pagination by using Laravel's request facade
  • Fix: Added IDE autocompletion to pagination instances by adding a mixin annotation to Collection

Version 2.4.1

07 Apr 16:39
4dcc3b1

Choose a tag to compare

Change log

  • Fix: Previous release was broken.

Version 2.4.0

07 Apr 14:56
888938e

Choose a tag to compare

Change log

  • Feature: Made aggregations available on result collections

Version 2.3.1

06 Apr 14:02
d2cffd6

Choose a tag to compare

Change log

  • Fix: Maximum score would inadvertedly be cast to an integer, during collection construction, loosing the float precision (#28)
  • Fix: Duration would inadvertedly be cast to an integer during collection construction, loosing the float precision (#29)
  • Fix: Highlights would not be read due to the field name being misspelt