You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: core/filters.md
+7-2Lines changed: 7 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -136,6 +136,10 @@ Case insensitivity may already be enforced at the database level depending on th
136
136
used. If you are using MySQL, note that the commonly used `utf8_unicode_ci` collation (and its sibling `utf8mb4_unicode_ci`)
137
137
are already case insensitive, as indicated by the `_ci` part in their names.
138
138
139
+
Note: Search filters with the exact strategy can have multiple values for a same property (in this case the condition will be similar to a SQL IN clause).
140
+
141
+
Syntax: `?property[]=foo&property[]=bar`
142
+
139
143
In the following example, we will see how to allow the filtering of a list of e-commerce offers:
140
144
141
145
```php
@@ -160,6 +164,7 @@ class Offer
160
164
161
165
`http://localhost:8000/api/offers?price=10`will return all offers with a price being exactly `10`.
162
166
`http://localhost:8000/api/offers?name=shirt`will return all offers with a description containing the word "shirt".
167
+
`http://localhost:8000/api/offers?name[]=shirt&name[]=sweat`will return all offers with a description containing the word "shirt" or containing the word "sweat".
163
168
164
169
Filters can be combined together: `http://localhost:8000/api/offers?price=10&name=shirt`
165
170
@@ -680,7 +685,7 @@ final class RegexpFilter extends AbstractContextAwareFilter
680
685
) {
681
686
return;
682
687
}
683
-
688
+
684
689
$parameterName = $queryNameGenerator->generateParameterName($property); // Generate a unique parameter name to avoid collisions with other filters
0 commit comments