docs(filters): document search filter family by soyuka · Pull Request #2338 · api-platform/docs · GitHub
Skip to content

docs(filters): document search filter family - #2338

Merged
soyuka merged 2 commits into
api-platform:4.4from
soyuka:docs/search-filter-family
Sep 13, 2026
Merged

soyuka merged 2 commits into
api-platform:4.4from
soyuka:docs/search-filter-family

Conversation

@soyuka

@soyuka soyuka commented Sep 12, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Documents StartSearchFilter, EndSearchFilter, and WordStartSearchFilter (core #8328, #8319) for both Doctrine ORM and MongoDB ODM in core/doctrine-filters.md, including the #[QueryParameter] declaration, the exact LIKE/regex pattern each generates, and the case-sensitivity default for each backend.
  • Splits the SearchFilter -> modern filter migration table row that previously mapped partial, start, end, word_start strategies all onto PartialSearchFilter, into distinct rows pointing at the new dedicated filters.
  • Documents the FreeTextQueryFilter per-property array<string, FilterInterface> constructor argument (core #8257), with a worked example (partial match on title, exact match on isbn) and the behavior for a property missing from the map.
  • Fills in the previously bare laravel/filters.md bullets for StartSearchFilter/EndSearchFilter with a working example, and notes there is no Eloquent equivalent of WordStartSearchFilter.
  • Adds StartSearchFilter, EndSearchFilter, and WordStartSearchFilter to the summary filter list in core/filters.md, matching the existing ExactFilter/PartialSearchFilter entry shape and cross-linking to the new core/doctrine-filters.md sections.

Stacked on #2335

This branch is based on docs/backport-4.4-features (tip faba151f7b34ac52bee024bbb90b4dd1074cf39e), which already rewrites large parts of core/doctrine-filters.md and adds ~10 lines to core/filters.md. Please merge #2335 first, then rebase/merge this on top of it — basing on upstream/4.4 directly would conflict.

Verified against

  • ApiPlatform\Doctrine\Orm\Filter\{Start,End,WordStart}SearchFilter and ApiPlatform\Doctrine\Odm\Filter\{Start,End,WordStart}SearchFilter at upstream/4.4 in api-platform/core.
  • ApiPlatform\Laravel\Eloquent\Filter\{Start,End}SearchFilter at the same ref — confirmed no WordStartSearchFilter exists under src/Laravel/Eloquent/Filter/.
  • ApiPlatform\Doctrine\{Orm,Odm}\Filter\FreeTextQueryFilter constructor (FilterInterface|array $filter) at the same ref.

Key findings baked into the docs:

  • ORM string filters (Start/End/WordStart) default to case-insensitive (LOWER() comparison); ODM defaults to case-sensitive (regex without the i flag) — opposite defaults, both configurable via the caseSensitive constructor argument.
  • ORM WordStartSearchFilter recognizes a word boundary only on a literal ASCII space (LIKE 'value%' OR LIKE '% value%'); ODM recognizes any whitespace character (\s) via (^value|\svalue).
  • Laravel Start/EndSearchFilter use QueryPropertyTrait only (no NestedPropertyTrait), so unlike PartialSearchFilter they do not support dot-notation relation filtering.

Out of scope / left for other agents

  • The pre-existing SearchFilter deprecation > [!WARNING] callout, and the RangeFilter/ComparisonFilter wording elsewhere in core/filters.md, were left untouched per instructions — owned by other agents.
  • Noticed a pervasive pre-existing "chikens" typo (for "chickens") throughout the example URLs in core/doctrine-filters.md, predating this change. Deliberately left as-is — it's cosmetic and repeated across many examples, so it deserves its own PR rather than riding along in this one.

Adds Start/End/WordStartSearchFilter (ORM+ODM, #8328/#8319) and the
FreeTextQueryFilter per-property filter map (#8257) to
core/doctrine-filters.md, cross-referenced from the SearchFilter
strategy migration table. Fills in the Laravel StartSearchFilter and
EndSearchFilter bullets in laravel/filters.md with a working example
and notes there is no Eloquent WordStartSearchFilter.
@soyuka
soyuka force-pushed the docs/search-filter-family branch from f359e65 to 9eb118d Compare September 13, 2026 06:31
@soyuka
soyuka merged commit 5c11d72 into api-platform:4.4 Sep 13, 2026
3 checks passed
@soyuka
soyuka deleted the docs/search-filter-family branch September 13, 2026 06:35
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