Skip to content

Commit acaf29c

Browse files
committed
fix #2196
1 parent 5197a0e commit acaf29c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

core/filters.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ use ApiPlatform\Metadata\QueryParameter;
123123
new GetCollection(
124124
parameters: [
125125
'search[:property]' => new QueryParameter(
126-
filter: new SearchFilter(properties: ['title' => 'partial', 'description' => 'partial'])
126+
filter: 'api_platform.doctrine.orm.search_filter.instance'
127127
)
128128
]
129129
)
@@ -149,6 +149,8 @@ public function apply(QueryBuilder $queryBuilder, QueryNameGeneratorInterface $q
149149
}
150150
```
151151

152+
Note that we're using `api_platform.doctrine.orm.search_filter.instance` (exists also for ODM). Indeed this is a special instance of the search filter where `properties` can be changed during runtime. This is considered as "legacy filter" below, in API Platform 4.0 we'll recommend to create a custom filter or to use the `PartialSearchFilter`.
153+
152154
### Restricting Properties with `:property` Placeholders
153155

154156
There are two different approaches to property restriction depending on your filter design:

0 commit comments

Comments
 (0)