-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Labels
Component: SalesFixed in 2.1.xThe issue has been fixed in 2.1 release lineThe issue has been fixed in 2.1 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentbug report

Description
Filter Group Builder OR doesn't work only AND works.
Its wrong according to the Docs here
http://devdocs.magento.com/guides/v2.1/howdoi/webapi/search-criteria.html
$productFilters[] = $this->filterBuilder->setField('sku')
->setValue('%'.$productSearch.'%')
->setConditionType('like')
->create();
$productFilters[] = $this->filterBuilder->setField('name')
->setValue('%'.$productSearch.'%')
->setConditionType('like')
->create();
$filter_group_products = $this->filterGroup
->setFilters($productFilters)
->create();
$searchCriteriaProducts = $this->searchCriteriaBuilder
->setFilterGroups([$filter_group_products])
->create();
$listProducts = $this->orderItemRepository->getList($searchCriteriaProducts);
makes this query with a AND
SELECT `main_table`.* FROM `sales_order_item` AS `main_table` WHERE (`sku` LIKE '%80705%') AND (`name` LIKE '%80705%')
According to your docs is should make this with a OR
SELECT `main_table`.* FROM `sales_order_item` AS `main_table` WHERE (`sku` LIKE '%80705%') OR (`name` LIKE '%80705%')
Preconditions
- Magento 2.1.3
- PHP 7.1w
- Percona 5.6
Steps to reproduce
- Call the first example above.
- Look at query in mysql work bench
- No data gets pulled because its using a AND
Expected result
-
- Data should get pulled because it's using a OR
Actual result
@igrybkov I think this has something to do with your update on
19d8137
Metadata
Metadata
Assignees
Labels
Component: SalesFixed in 2.1.xThe issue has been fixed in 2.1 release lineThe issue has been fixed in 2.1 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentbug report