AdobeDocs / AdobeDocs/commerce-webapi
List of search criteria conditions in /main/src/pages/rest/use-rest/performing-searches.md is wrong
- Dominant language
- JavaScript
- Stars
- 13
- Forks
- 120
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 8
Description
The list of conditions that can be used in search criteria is listed as:
| Condition | Notes |
| --- | --- |
| `eq` | Equals |
| `finset` | A value within a set of values |
| `from` | The beginning of a range. Must be used with `to`. |
| `gt` | Greater than |
| `gteq` | Greater than or equal |
| `in` | In. The `value` can contain a comma-separated list of values. |
| `like` | Like. The `value` can contain the SQL wildcard characters when `like` is specified. |
| `lt` | Less than |
| `lteq` | Less than or equal |
| `moreq` | More or equal |
| `neq` | Not equal |
| `nfinset` | A value that is not within a set of values. |
| `nin` | Not in. The `value` can contain a comma-separated list of values. |
| `nlike` | Not like |
| `notnull` | Not null |
| `null` | Null |
| `to` | The end of a range. Must be used with `from`. |
However, there are two separate issues with this, when looking at the actual code that executes:
1. `moreq` is not supported. Looking at https://github.com/magento/magento2/blob/011a4d0a5ad75945b2573ad01cd5815b1e4f6c52/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php#L3235-L3259, we can see that it is not in the condition map.
2. `regexp`, `seq`, and `sneq`are valid conditions, but not listed - we can see these in the same code block linked in point 1.
Note that there are a couple of other conditions that are in the map, but are essentially useless, which is why I haven't included them in the list.
Contributor guide
Research direction
Open /main/src/pages/rest/use-rest/performing-searches.md and compare its search-condition table with the condition map in lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php around lines 3235-3259. Remove the unsupported condition, add the valid missing conditions, and verify that the table matches the code while excluding the known useless entries.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- api, documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 92/100