Questions tagged [search-criteria]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
14 votes
2 answers
15k views

Magento 2: Product Repositories, Filter Groups, and `AND`

I'm trying to use a product repository to fetch a list of products. I want to fetch based on two filters, combined with an AND criteria, but things don't seem to be working. Do I not understand how ...
Alana Storm's user avatar
  • 44.3k
29 votes
2 answers
38k views

Filtering a Magento 2 Object Repository

In Magento 2, can you use a product repository to filter by product attributes? In Magento 2, you can use a search criteria object \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria, ...
Alana Storm's user avatar
  • 44.3k
11 votes
3 answers
24k views

Magento2: How to add multiple AND and OR conditions to filter/filterGroups?

The question is too close to this topic: Magento 2: Product Repositories, Filter Groups, and `AND` but is it possible to create criteria with multiple OR and AND? In my case i would like to create ...
Anthony's user avatar
  • 784
7 votes
2 answers
9k views

Using searchCriteria while searching attributes in magento 2.0

Fetching attribute info, if I apply multiple filters in a single search criteria, it does not work. But in case of single filter it works perfectly. Multiple filters HTTP request: http://192.168.1....
devdoe's user avatar
  • 460
25 votes
2 answers
31k views

What are the allowed condition types in Magento 2?

What is the list of allowed condition types while adding filter to search criteria in Magento 2? All of the examples about search criteria in the internet use eq condition type. Is there any other? ...
Bunyamin Inan's user avatar
4 votes
1 answer
2k views

How to use V1/search to get the names and SKU's of the magento products

How to use V1/search to get the names and SKU's of the magento products? I need a text based search to get the names and SKU's of the magento products. While using V1/products API, the response is ...
devdoe's user avatar
  • 460
2 votes
1 answer
3k views

How can we return an array of search results in APIs Magento 2

I need to return array of search results and so far I did this. DashBoardInterface.php <?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ ...
Ramkishan Suthar's user avatar
1 vote
1 answer
3k views

Magento2 Rest Api Search Criteria not working properly!

I am trying to get the sales orders from magento2 REST API. I am using the below query to get the complete orders within entity_id range: $ch = curl_init( Helper::getURL() . "orders?searchCriteria[...
Mohammad Hammadi's user avatar
1 vote
1 answer
2k views

filtering orderList with multiple filter searchCriteria in 'AND' logic

I am trying to filter the order list based on two filters. So far, all of my attempts failed and didn't work. The filter is not working properly and it returns very first order in list of orders in ...
Korbin's user avatar
  • 298
1 vote
1 answer
351 views

SearchCriteria Logical OR and AND search

I am trying to get a search criteria to become the following SQL: WHERE (a = 1 AND b = 2) OR (c = 3) Magento2 Documentation only has the example where AND and OR are reversed. Is this even possible? ...
Domeglic's user avatar
  • 542
0 votes
1 answer
863 views

How to use custom product attribute in sorting option with search criteria builder for magento 2?

I have created one custom product attribute(bestseller). Now I want to sort by custom product attribute(bestseller) using search criteria builder sort by option but it's not working for custom product ...
Jitendra Patel's user avatar
0 votes
2 answers
1k views

searchCriteriaBuilder using multiple sort

I've been experimenting with SearchCriteriaBuilder but I can't seem to get the syntax right to apply multiple sort. I've tried this $this->searchCriteriaBuilder->addFilter(EntryInterface::...
Dominic Pixie's user avatar