Skip to content

feat: add elasticsearch RangeFilter support - #7910

Closed
sazzabi-fcms wants to merge 2 commits into
api-platform:mainfrom
sazzabi-fcms:range-filter
Closed

sazzabi-fcms wants to merge 2 commits into
api-platform:mainfrom
sazzabi-fcms:range-filter

Conversation

@sazzabi-fcms

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

Copy link
Copy Markdown
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 {}

@soyuka

soyuka commented Sep 12, 2026

Copy link
Copy Markdown
Member

Closing this because RangeFilter is deprecated in favor of ComparisonFilter. We would accept an Elasticsearch ComparisonFilter implementation aligned with the current API and covering the gt, gte, lt, and lte operators. Thanks for the contribution.

@soyuka soyuka closed this Sep 12, 2026
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.

2 participants