spatie/elasticsearch-query-builder
Build and execute an Elasticsearch search query using a fluent PHP API
3.11.0
905K downloads/mo
#3255 most downloaded on Packagist
spatie/elasticsearch-query-builder
What this package is like to depend on
Last release 25 days ago
29 Jul 2026
Ships fairly regularly
a new release about every 2 months
Nearly every release is documented
notes for 36 of 37 stable releases
Nothing withdrawn
no release was ever pulled
5 years old
37 releases · first in 2021
5 releases in the last 12 months
see the full history below
Release timeline
37 releases · Jun 2021 to Jul 2026Releases
latest 37-
3.11.029 Jul 2026Release notes
Open source →What's Changed
- Fix
ReverseNestedAggregationemitting an emptyaggsarray by @ramicbenjamin in #83 - Add RangeAggregation by @ramicbenjamin in #84
New Contributors
- @ramicbenjamin made their first contribution in #83
Full Changelog: 3.10.0...3.11.0
Release notes
Open source →What's Changed
- Fix
ReverseNestedAggregationemitting an emptyaggsarray by @ramicbenjamin in https://github.com/spatie/elasticsearch-query-builder/pull/83 - Add RangeAggregation by @ramicbenjamin in https://github.com/spatie/elasticsearch-query-builder/pull/84
New Contributors
- @ramicbenjamin made their first contribution in https://github.com/spatie/elasticsearch-query-builder/pull/83
Full Changelog: https://github.com/spatie/elasticsearch-query-builder/compare/3.10.0...3.11.0
- Fix
-
3.10.028 Apr 2026Release notes
Open source →What's Changed
- Add source() and retrieveFields(), deprecate fields() by @freekmurze in #82
New Contributors
- @freekmurze made their first contribution in #82
Full Changelog: 3.9.2...3.10.0
Release notes
Open source →What's Changed
- Add source() and retrieveFields(), deprecate fields() by @freekmurze in https://github.com/spatie/elasticsearch-query-builder/pull/82
New Contributors
- @freekmurze made their first contribution in https://github.com/spatie/elasticsearch-query-builder/pull/82
Full Changelog: https://github.com/spatie/elasticsearch-query-builder/compare/3.9.2...3.10.0
-
3.9.205 Jan 2026Release notes
Open source →What's Changed
- feat: Enhance Builder class by adding Conditionable trait for improved query capabilities by @greezen in #79
New Contributors
Full Changelog: 3.9.1...3.9.2
Release notes
Open source →What's Changed
- feat: Enhance Builder class by adding Conditionable trait for improved query capabilities by @greezen in https://github.com/spatie/elasticsearch-query-builder/pull/79
New Contributors
- @greezen made their first contribution in https://github.com/spatie/elasticsearch-query-builder/pull/79
Full Changelog: https://github.com/spatie/elasticsearch-query-builder/compare/3.9.1...3.9.2
-
3.9.101 Dec 2025Release notes
Open source →What's Changed
- Terms aggregation: Support "include" and "exclude" options for filtering values by @sventendo in #78
Full Changelog: 3.9.0...3.9.1
Release notes
Open source →What's Changed
- Terms aggregation: Support "include" and "exclude" options for filtering values by @sventendo in https://github.com/spatie/elasticsearch-query-builder/pull/78
Full Changelog: https://github.com/spatie/elasticsearch-query-builder/compare/3.9.0...3.9.1
-
3.9.029 Sep 2025Release notes
Open source →What's Changed
- Update issue template by @AlexVanderbist in #77
- Added
ScriptSorton Query Builder by @chirag-techrayslabs in #75 - Comprehensive ElasticSearch Query and Aggregation Enhancement by @summerKK in #76
New Contributors
- @AlexVanderbist made their first contribution in #77
Full Changelog: 3.8.1...3.9.0
Release notes
Open source →What's Changed
- Update issue template by @AlexVanderbist in https://github.com/spatie/elasticsearch-query-builder/pull/77
- Added
ScriptSorton Query Builder by @chirag-techrayslabs in https://github.com/spatie/elasticsearch-query-builder/pull/75 - Comprehensive ElasticSearch Query and Aggregation Enhancement by @summerKK in https://github.com/spatie/elasticsearch-query-builder/pull/76
New Contributors
- @AlexVanderbist made their first contribution in https://github.com/spatie/elasticsearch-query-builder/pull/77
Full Changelog: https://github.com/spatie/elasticsearch-query-builder/compare/3.8.1...3.9.0
-
3.8.104 Aug 2025Release notes
Open source →What's Changed
- Add isEmpty method to BoolQuery by @floristenhove in #72
- Fix missing parameter type restrictions in aggregations and sorts by @summerKK in #74
Full Changelog: 3.8.0...3.8.1
Release notes
Open source →What's Changed
- Add isEmpty method to BoolQuery by @floristenhove in https://github.com/spatie/elasticsearch-query-builder/pull/72
- Fix missing parameter type restrictions in aggregations and sorts by @summerKK in https://github.com/spatie/elasticsearch-query-builder/pull/74
Full Changelog: https://github.com/spatie/elasticsearch-query-builder/compare/3.8.0...3.8.1
-
3.8.005 Jun 2025Release notes
Open source →What's Changed
- Add operator, boost, prefix length, and max expansions to MultiMatchQuery by @floristenhove in #71
Full Changelog: 3.7.0...3.8.0
Release notes
Open source →What's Changed
- Add operator, boost, prefix length, and max expansions to MultiMatchQuery by @floristenhove in https://github.com/spatie/elasticsearch-query-builder/pull/71
Full Changelog: https://github.com/spatie/elasticsearch-query-builder/compare/3.7.0...3.8.0
-
3.7.014 Apr 2025Release notes
Open source →What's Changed
- Add DateHistogramAggregation by @Crmteam-IVG in #66
New Contributors
- @Crmteam-IVG made their first contribution in #66
Full Changelog: 3.6.0...3.7.0
Release notes
Open source →What's Changed
- Add DateHistogramAggregation by @Crmteam-IVG in https://github.com/spatie/elasticsearch-query-builder/pull/66
New Contributors
- @Crmteam-IVG made their first contribution in https://github.com/spatie/elasticsearch-query-builder/pull/66
Full Changelog: https://github.com/spatie/elasticsearch-query-builder/compare/3.6.0...3.7.0
-
3.6.010 Mar 2025Release notes
Open source →What's Changed
- Add the min_score to the builder by @wgriffioen in #68
New Contributors
- @wgriffioen made their first contribution in #68
Full Changelog: 3.5.1...3.6.0
Release notes
Open source →What's Changed
- Add the min_score to the builder by @wgriffioen in https://github.com/spatie/elasticsearch-query-builder/pull/68
New Contributors
- @wgriffioen made their first contribution in https://github.com/spatie/elasticsearch-query-builder/pull/68
Full Changelog: https://github.com/spatie/elasticsearch-query-builder/compare/3.5.1...3.6.0
-
3.5.119 Feb 2025Release notes
Open source →What's Changed
- Collapse: Make use of nested inner hits query object by @sventendo in #67
Full Changelog: 3.5.0...3.5.1
Release notes
Open source →What's Changed
- Collapse: Make use of nested inner hits query object by @sventendo in https://github.com/spatie/elasticsearch-query-builder/pull/67
Full Changelog: https://github.com/spatie/elasticsearch-query-builder/compare/3.5.0...3.5.1
-
3.5.011 Feb 2025Release notes
Open source →What's Changed
- Add elasticsearch
collapseon query builder by @chirag-techrayslabs in https://github.com/spatie/elasticsearch-query-builder/pull/65
New Contributors
- @chirag-techrayslabs made their first contribution in https://github.com/spatie/elasticsearch-query-builder/pull/65
Full Changelog: https://github.com/spatie/elasticsearch-query-builder/compare/3.4.0...3.5.0
- Add elasticsearch
-
3.4.010 Feb 2025Release notes
Open source →What's Changed
- Add MultiBuilder to support multi-search API by @chrispappas in https://github.com/spatie/elasticsearch-query-builder/pull/64
New Contributors
- @chrispappas made their first contribution in https://github.com/spatie/elasticsearch-query-builder/pull/64
Full Changelog: https://github.com/spatie/elasticsearch-query-builder/compare/3.3.0...3.4.0
-
3.3.020 Jan 2025Release notes
Open source →What's Changed
- Add boost parameter to Terms query by @floristenhove in https://github.com/spatie/elasticsearch-query-builder/pull/54
- Nested query improvements by @dam-bal in https://github.com/spatie/elasticsearch-query-builder/pull/53
Full Changelog: https://github.com/spatie/elasticsearch-query-builder/compare/3.2.2...3.3.0
-
3.2.217 Jan 2025Release notes
Open source →What's Changed
- Fix missing args for create func by @l3aro in https://github.com/spatie/elasticsearch-query-builder/pull/60
Full Changelog: https://github.com/spatie/elasticsearch-query-builder/compare/3.2.1...3.2.2
-
3.2.117 Jan 2025Release notes
Open source →What's Changed
- Support operator in MatchQuery by @l3aro in https://github.com/spatie/elasticsearch-query-builder/pull/59
New Contributors
- @l3aro made their first contribution in https://github.com/spatie/elasticsearch-query-builder/pull/59
Full Changelog: https://github.com/spatie/elasticsearch-query-builder/compare/3.2.0...3.2.1
-
3.2.021 Nov 2024Release notes
Open source →What's Changed
- Add percolate query by @floristenhove in https://github.com/spatie/elasticsearch-query-builder/pull/57
- Allow setting values to null for RangeQuery by @bram-pkg in https://github.com/spatie/elasticsearch-query-builder/pull/56
- Add geoshape query by @floristenhove in https://github.com/spatie/elasticsearch-query-builder/pull/58
New Contributors
- @floristenhove made their first contribution in https://github.com/spatie/elasticsearch-query-builder/pull/57
- @bram-pkg made their first contribution in https://github.com/spatie/elasticsearch-query-builder/pull/56
Full Changelog: https://github.com/spatie/elasticsearch-query-builder/compare/3.1.0...3.2.0
-
3.1.003 Oct 2024Release notes
Open source →What's Changed
- feat: add MatchPhraseQuery by @summerKK in https://github.com/spatie/elasticsearch-query-builder/pull/50
New Contributors
- @summerKK made their first contribution in https://github.com/spatie/elasticsearch-query-builder/pull/50
Full Changelog: https://github.com/spatie/elasticsearch-query-builder/compare/3.0.0...3.1.0
-
3.0.006 May 2024Release notes
Open source →See upgrading.md for possible breaking changes.
What's Changed
- Added Nested Sort by @dam-bal in https://github.com/spatie/elasticsearch-query-builder/pull/46
New Contributors
- @dam-bal made their first contribution in https://github.com/spatie/elasticsearch-query-builder/pull/46
Full Changelog: https://github.com/spatie/elasticsearch-query-builder/compare/2.7.0...3.0.0
-
2.7.006 May 2024Release notes
Open source →What's Changed
- Allow
boolandintas types for term query by @sventendo in https://github.com/spatie/elasticsearch-query-builder/pull/34 - Fix: Include
sizeandfromin getPayload by @harlequin410 in https://github.com/spatie/elasticsearch-query-builder/pull/35 - Allow filter aggregation without using nested aggregations by @sventendo in https://github.com/spatie/elasticsearch-query-builder/pull/37
New Contributors
- @sventendo made their first contribution in https://github.com/spatie/elasticsearch-query-builder/pull/34
- @harlequin410 made their first contribution in https://github.com/spatie/elasticsearch-query-builder/pull/35
Full Changelog: https://github.com/spatie/elasticsearch-query-builder/compare/2.6.0...2.7.0
- Allow
-
2.6.025 Apr 2024Release notes
Open source →What's Changed
- Add minimum_should_match support for BoolQuery by @srowan in https://github.com/spatie/elasticsearch-query-builder/pull/38
New Contributors
- @srowan made their first contribution in https://github.com/spatie/elasticsearch-query-builder/pull/38
Full Changelog: https://github.com/spatie/elasticsearch-query-builder/compare/2.5.0...2.6.0
-
2.5.025 Apr 2024Release notes
Open source →What's Changed
- Add boost parameter to MatchQuery by @MilanLamote in https://github.com/spatie/elasticsearch-query-builder/pull/42
Full Changelog: https://github.com/spatie/elasticsearch-query-builder/compare/2.4.0...2.5.0
-
2.4.019 Apr 2024Release notes
Open source →What's Changed
- Add post filter logic and enhance readme by @MilanLamote in https://github.com/spatie/elasticsearch-query-builder/pull/41
Full Changelog: https://github.com/spatie/elasticsearch-query-builder/compare/2.3.0...2.4.0
-
2.3.017 Apr 2024Release notes
Open source →What's Changed
- Add highlighting by @MilanLamote in https://github.com/spatie/elasticsearch-query-builder/pull/39
New Contributors
- @MilanLamote made their first contribution in https://github.com/spatie/elasticsearch-query-builder/pull/39
Full Changelog: https://github.com/spatie/elasticsearch-query-builder/compare/2.2.0...2.3.0
-
2.2.026 Mar 2024Release notes
Open source →What's Changed
- Added able track total hits by @nick-rashkevich in https://github.com/spatie/elasticsearch-query-builder/pull/36
New Contributors
- @nick-rashkevich made their first contribution in https://github.com/spatie/elasticsearch-query-builder/pull/36
Full Changelog: https://github.com/spatie/elasticsearch-query-builder/compare/2.1.0...2.2.0
-
2.1.017 Feb 2023Release notes
Open source →What's Changed
- IB-1280 added sum aggregation by @webbaard in https://github.com/spatie/elasticsearch-query-builder/pull/26
New Contributors
- @webbaard made their first contribution in https://github.com/spatie/elasticsearch-query-builder/pull/26
Full Changelog: https://github.com/spatie/elasticsearch-query-builder/compare/2.0.1...2.1.0
-
2.0.110 Oct 2022Release notes
Open source →What's Changed
- Fix
Builder::search()return data type by @imdhemy in https://github.com/spatie/elasticsearch-query-builder/pull/24
New Contributors
- @imdhemy made their first contribution in https://github.com/spatie/elasticsearch-query-builder/pull/24
Full Changelog: https://github.com/spatie/elasticsearch-query-builder/compare/2.0.0...2.0.1
- Fix
-
2.0.022 Jul 2022Release notes
Open source →What's Changed
- Elasticseach ^8.0 support by @h-rafiee in https://github.com/spatie/elasticsearch-query-builder/pull/19
New Contributors
- @h-rafiee made their first contribution in https://github.com/spatie/elasticsearch-query-builder/pull/19
Full Changelog: https://github.com/spatie/elasticsearch-query-builder/compare/1.4.0...2.0.0
-
1.4.020 Jul 2022 -
1.3.006 Aug 2021 -
1.2.229 Jul 2021 -
1.2.129 Jul 2021 -
1.2.028 Jul 2021 -
1.1.222 Jul 2021 -
1.1.122 Jul 2021 -
1.1.022 Jul 2021 -
1.0.007 Jul 2021 -
0.0.124 Jun 2021Nothing published for this version