September 2018
Beginner to intermediate
218 pages
4h 27m
English
The searchCriteria parameter of a GET request allows for search results filtering. The key to using it comes down to understanding its structure and the available condition types.
Observing the \Magento\Framework\Api\SearchCriteriaInterface interface, and the Magento\Framework\Api\SearchCriteria class as its concrete implementation, we can easily conclude the following search_criteria structure:
"search_criteria": { "filter_groups": [], "current_page": 1, "page_size": 10, "sort_orders": [] }
Whereas the mandatory filter_groups parameter and its structure are shown as follows:
"filter_groups": [ { "filters": [ { "field": "fieldOrAttrName", "value": "fieldOrAttrValue", "condition_type": "eq" }, { // Logical OR ...
Read now
Unlock full access