Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 35a46e4

Browse files
Update performing-searches.md (#8400)
* Update performing-searches.md Added Example of in and nin operator. * Update performing-searches.md * Update performing-searches.md Co-authored-by: Kevin Harper <[email protected]>
1 parent 2d8a614 commit 35a46e4

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

src/guides/v2.3/rest/performing-searches.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ where:
2121

2222
Condition | Notes
2323
--- | ---
24-
`eq` | Equals.
24+
`eq` | Equals
2525
`finset` | A value within a set of values
26-
`from` | The beginning of a range. Must be used with `to`
26+
`from` | The beginning of a range. Must be used with `to`.
2727
`gt` | Greater than
2828
`gteq` | Greater than or equal
2929
`in` | In. The `value` can contain a comma-separated list of values.
@@ -32,11 +32,11 @@ Condition | Notes
3232
`lteq` | Less than or equal
3333
`moreq` | More or equal
3434
`neq` | Not equal
35-
`nfinset` | A value that is not within a set of values
35+
`nfinset` | A value that is not within a set of values.
3636
`nin` | Not in. The `value` can contain a comma-separated list of values.
3737
`notnull` | Not null
3838
`null` | Null
39-
`to` | The end of a range. Must be used with `from`
39+
`to` | The end of a range. Must be used with `from`.
4040

4141
{:.bs-callout-info}
4242
`condition_type` is optional if the operator is `eq`.
@@ -93,6 +93,18 @@ searchCriteria[filter_groups][0][filters][0][value]=2016-07-01 00:00:00&
9393
searchCriteria[filter_groups][0][filters][0][condition_type]=gt
9494
```
9595

96+
## Simple search using an `in` conditions type
97+
98+
The following search finds all the products that are provided in the value field. When you specify the `in` condition type, the value field must be a comma separated list.
99+
100+
```http
101+
GET <host>/rest/<store_code>/V1/products?
102+
searchCriteria[filter_groups][0][filters][0][field]=entity_id&
103+
searchCriteria[filter_groups][0][filters][0][value]=1,2,3,4,5&
104+
searchCriteria[filter_groups][0][filters][0][condition_type]=in
105+
```
106+
The query returns 5 items.
107+
96108
### Logical OR search
97109

98110
The following example searches for all products whose names contain the string `Leggings` or `Parachute`. The instances of `%25` in the example are converted into the SQL wildcard character `%`.

0 commit comments

Comments
 (0)