feat(doctrine): add StartSearchFilter and WordStartSearchFilter (ORM + ODM)#8328
Merged
soyuka merged 1 commit intoJun 17, 2026
Conversation
…+ ODM) Ports the LIKE 'value%' prefix search and the word-boundary prefix search to the canonical Doctrine filter family for 4.4, mirroring EndSearchFilter. StartSearchFilter matches strings starting with the value (ORM LIKE 'value%', ODM /^value/). WordStartSearchFilter matches any word starting with the value (ORM LIKE 'value%' OR '% value%', ODM /(^value|\svalue)/), with parity to the legacy SearchFilter word_start strategy. Both are new primary filters: not experimental, not deprecated. Additive, zero BC break.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two new primary Doctrine search filters for 4.4, completing the canonical search family alongside the recently merged
EndSearchFilter(#8319) andPartialSearchFilter:StartSearchFilter— prefix match. ORMLIKE 'value%', ODM/^value/.WordStartSearchFilter— word-boundary prefix. ORMLIKE 'value%' OR LIKE '% value%', ODM/(^value|\svalue)/, matching the legacySearchFilterword_startstrategy.How
All four classes (ORM + ODM × 2) mirror
EndSearchFilterexactly:final class … implements FilterInterface, OpenApiParameterFilterInterface, same three traits (BackwardCompatibleFilterDescriptionTrait,NestedPropertyHelperTrait/ODM equivalent,OpenApiFilterTrait), samebool $caseSensitivector default (ORMfalse, ODMtrue), same scalar/iterable branching andESCAPE '\'LIKE construction. Values escaped viaaddcslashes($value, '\\%_').These are new primary filters: not
@experimental, not@deprecated— the recommended way going forward.BC
Purely additive (4 new filter classes + 2 functional tests + Chicken fixture wiring). Zero BC break.
Tests
New functional tests under
tests/Functional/Parameters/for both filters, ORM + ODM, wired into theChickenfixture (nameStart,nameStartSensitive,nameWordStart, plus no-property variants). ORM suites green locally; ODM exercised in CI (no local mongod).Part of the 4.4 filter refactor (ship replacement primaries before deprecating legacy counterparts).