PackageTrack
Sign in Get early access

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 2026
2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 37
  1. 3.11.0 29 Jul 2026
    Release notes

    What's Changed

    New Contributors

    Full Changelog: 3.10.0...3.11.0

    Open source →
    Release notes

    What's Changed

    • Fix ReverseNestedAggregation emitting an empty aggs array 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

    Open source →
  2. 3.10.0 28 Apr 2026
    Release notes

    What's Changed

    • Add source() and retrieveFields(), deprecate fields() by @freekmurze in #82

    New Contributors

    Full Changelog: 3.9.2...3.10.0

    Open source →
    Release notes

    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

    Open source →
  3. 3.9.2 05 Jan 2026
    Release notes

    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

    Open source →
    Release notes

    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

    Open source →
  4. 3.9.1 01 Dec 2025
    Release notes

    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

    Open source →
    Release notes

    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

    Open source →
  5. 3.9.0 29 Sep 2025
    Release notes

    What's Changed

    New Contributors

    Full Changelog: 3.8.1...3.9.0

    Open source →
    Release notes

    What's Changed

    • Update issue template by @AlexVanderbist in https://github.com/spatie/elasticsearch-query-builder/pull/77
    • Added ScriptSort on 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

    Open source →
  6. 3.8.1 04 Aug 2025
    Release notes

    What's Changed

    Full Changelog: 3.8.0...3.8.1

    Open source →
    Release notes

    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

    Open source →
  7. 3.8.0 05 Jun 2025
    Release notes

    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

    Open source →
    Release notes

    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

    Open source →
  8. 3.7.0 14 Apr 2025
    Release notes

    What's Changed

    New Contributors

    Full Changelog: 3.6.0...3.7.0

    Open source →
    Release notes

    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

    Open source →
  9. 3.6.0 10 Mar 2025
    Release notes

    What's Changed

    New Contributors

    Full Changelog: 3.5.1...3.6.0

    Open source →
    Release notes

    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

    Open source →
  10. 3.5.1 19 Feb 2025
    Release notes

    What's Changed

    • Collapse: Make use of nested inner hits query object by @sventendo in #67

    Full Changelog: 3.5.0...3.5.1

    Open source →
    Release notes

    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

    Open source →
  11. 3.5.0 11 Feb 2025
    Release notes

    What's Changed

    • Add elasticsearch collapse on 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

    Open source →
  12. 3.4.0 10 Feb 2025
    Release notes

    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

    Open source →
  13. 3.3.0 20 Jan 2025
    Release notes

    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

    Open source →
  14. 3.2.2 17 Jan 2025
    Release notes

    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

    Open source →
  15. 3.2.1 17 Jan 2025
    Release notes

    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

    Open source →
  16. 3.2.0 21 Nov 2024
    Release notes

    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

    Open source →
  17. 3.1.0 03 Oct 2024
    Release notes

    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

    Open source →
  18. 3.0.0 06 May 2024
    Release notes

    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

    Open source →
  19. 2.7.0 06 May 2024
    Release notes

    What's Changed

    • Allow bool and int as types for term query by @sventendo in https://github.com/spatie/elasticsearch-query-builder/pull/34
    • Fix: Include size and from in 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

    Open source →
  20. 2.6.0 25 Apr 2024
    Release notes

    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

    Open source →
  21. 2.5.0 25 Apr 2024
    Release notes

    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

    Open source →
  22. 2.4.0 19 Apr 2024
    Release notes

    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

    Open source →
  23. 2.3.0 17 Apr 2024
    Release notes

    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

    Open source →
  24. 2.2.0 26 Mar 2024
    Release notes

    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

    Open source →
  25. 2.1.0 17 Feb 2023
    Release notes

    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

    Open source →
  26. 2.0.1 10 Oct 2022
    Release notes

    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

    Open source →
  27. 2.0.0 22 Jul 2022
    Release notes

    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

    Open source →
  28. 1.4.0 20 Jul 2022
    Release notes
    • add TermsQuery
    Open source →
  29. 1.3.0 06 Aug 2021
    Release notes
    • add PrefixQuery
    Open source →
  30. 1.2.2 29 Jul 2021
    Release notes
    • remove debug statements (again :facepalm:)
    Open source →
  31. 1.2.1 29 Jul 2021
    Release notes
    • remove debug statements
    Open source →
  32. 1.2.0 28 Jul 2021
    Release notes
    • add type to MultiMatchQuery
    Open source →
  33. 1.1.2 22 Jul 2021
    Release notes
    • fix search_after parameter in request body
    Open source →
  34. 1.1.1 22 Jul 2021
    Release notes
    • add search_after to request body
    Open source →
  35. 1.1.0 22 Jul 2021
    Release notes
    • provide default sort order
    • add searchAfter method
    Open source →
  36. 1.0.0 07 Jul 2021
    Release notes
    • initial release
    Open source →
  37. 0.0.1 24 Jun 2021

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive