Skip to content

feat: add elasticsearch RangeFilter support#7910

Open
sazzabi-fcms wants to merge 1 commit intoapi-platform:mainfrom
sazzabi-fcms:range-filter
Open

feat: add elasticsearch RangeFilter support#7910
sazzabi-fcms wants to merge 1 commit intoapi-platform:mainfrom
sazzabi-fcms:range-filter

Conversation

@sazzabi-fcms
Copy link
Copy Markdown

@sazzabi-fcms sazzabi-fcms commented Apr 13, 2026

Q A
Branch? main
Tickets Closes #..., closes #...
License MIT
Doc PR api-platform/docs#...

This PR adds a RangeFilter for the Elasticsearch integration,
following the same pattern as the existing MatchFilter and TermFilter.

The RangeFilter enables range queries (gt, gte, lt, lte)
on numeric and date fields, including nested fields.

Motivation

The Elasticsearch filter suite currently lacks a range/comparison filter.
The ComparisonFilter that existed in previous versions was not ported to
Api Platform 4.x. This is a common use case — filtering by price, rating,
distance, opening hours, dates, etc.

Usage

#[ApiFilter(RangeFilter::class, properties: [
    'price',
    'rating',
    'created_at',
])]
class MyDto {}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant