Questions tagged [search-criteria]
The search-criteria tag has no usage guidance.
91
questions
1
vote
1
answer
1k
views
Set Join in SearchCriteria select
I need to override the get orders list API call, and set a join with my custom table, but without loose the SearchCriteria terms, is this possible?
Current Code:
(I've created a plugin in Magento\...
1
vote
0
answers
45
views
What is the proper way to perform a SEARCH with logic AND using the APIs?
I'm having trouble performing a search using the APIs. Below is the request I'm performing to my Magento backend:
http://www.mybackend.com/rest/it/V1/products?searchCriteria[filterGroups][0][filters][...
3
votes
1
answer
4k
views
Customer Repository Interface, Limit Results
I'm trying to grab the oldest customer, using the customer repository from the database.
Here's my code so far:
// if custom is active
$isActivefilter = $this->filter
->...
1
vote
0
answers
239
views
order api search criteria
I have two magento accounts and i am fetching order with below route :
("/rest/V1/customers/search?searchCriteria[page_size]=20000&searchCriteria[current_page]=1&searchCriteria[...
3
votes
0
answers
519
views
Magento 2 rest api: Ignore out of stock products in get products search criteria
I am using the following api call to get products.
{{base_url}}/rest/V1/products?searchCriteria[filter_groups][0][filters][0][condition_type]=like&searchCriteria[filter_groups][0][filters][0][...
2
votes
1
answer
3k
views
Magento 2 filter products by price from Rest API
Magento-2 we would like to filter the products from REST API
I have filtered product by price in the frontend please check the result in the below screenshot
(24-MB02 price and special price we ...
11
votes
3
answers
23k
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 ...
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 ...
1
vote
1
answer
346
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? ...
4
votes
3
answers
7k
views
Magento 2 Search Rest API
I need to change the response of Search Rest API in Magento 2.
Request:rest/V1/search?searchCriteria[requestName]=quick_search_container
&searchCriteria[filterGroups][0][filters][0][field]=...
25
votes
2
answers
30k
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? ...
0
votes
2
answers
788
views
Magento2: SearchCriteria OR/AND
use \Magento\CatalogSearch\Helper\Data as CatalogSearch;
use \Magento\Catalog\Model\Layer\Category\FilterableAttributeList;
use \Magento\Catalog\Api\ProductRepositoryInterface;
use \...
1
vote
1
answer
2k
views
Magento2: setFilterGroups(array) SearchCriteria Error
I have the following code:
$filter1 = $this->_filterBuilder->setField('name')
->setValue('%'.$searchTerm.'%')
->setConditionType("like")
->create();
$filter2 = $this->...
2
votes
1
answer
8k
views
Magento2: Collection to SearchCriteria
How to convert
$products = $this->_catalogSearchAdvanced
->getProductCollection()
->addStoreFilter($storeId)
->setCurPage($page)
->setPageSize($...
0
votes
1
answer
3k
views
Search Criteria for the products in magento 2
I have gone through the Search Criteria functionality to filter the products, for this I have created the custom attributesmart_search multiselect attribute. And I have written some code for filter ...
1
vote
1
answer
644
views
Retrieve extension_attributes with API searchCriteria working wrong
I created a new field on Creditmemos as an extension_attribute.
I thought is working fine, when I create a Creditmemo, the field is saved correctly in the ddbb and when I get the creditmemo with the ...
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[...
0
votes
0
answers
493
views
How to filter a product by a datetime attribute in Magento2?
I am trying to filter products on a search by an attribute of type 'datetime'. The problem is it does not filter by it, so it shows all the results. I have tested other attributes and it works fine, ...
0
votes
2
answers
934
views
Cannot search correct result
I have a product named C.I.D
However, I am not able to search it in Magento 2.0
I guess it's related to the dot character.
Anyone got idea on how to fix it?
Thanks
0
votes
1
answer
742
views
How can I accomodate category names also to the magento quick search?
I am new to magento2, I wanted to know how we can bring category names also to the quick search. For eg: When I search using a keyword 'Bag', I should get a list off all products under the category "...
10
votes
5
answers
6k
views
Magento 2 API: Filter orders by extension attribute
I have an extension with an attribute assigned to order items called warehouse.
I can see this attribute under the property "extension_attributes".
I need to filter orders based on this attribute. I ...
0
votes
1
answer
1k
views
Assign Multiple Filter to Single FilterGroup in magento 2
I am working on to get product from custom attributes using search criteria. i need to assign multiple filter to single filter group.
what i did:
$cus Query:
{"area":["320","321","322"],"city":"...
2
votes
0
answers
2k
views
Custom Attribute Search using SearchCriteria
I have created some custom attribute like city and I need to search how many products I have in a specific city using SearchCriteria.
The SearchCriteria I apply does not filter products on my city ...
2
votes
1
answer
2k
views
SearchCriteria with 'OR' filter
I would like to get Cms Pages from repository using search criteria.
I need to filter title and content fields.
This is how I'm trying to do this:
$this->filterBuilder->setField('title');
$this-...
7
votes
1
answer
2k
views
Magento 2: How to change Advanced Search from "AND" to "OR"?
I'm stuck with this situation:
I have 2 select-type attributes: A and B for example
In both of the attributes, I have the same list of Options (but they are different option ids)
For example
In ...
1
vote
1
answer
1k
views
Magento 2 cannot set searchCriteria to rest api for categories
Tried using the url below to get all sub-categories, but it retuns all categories without filtering.
http://127.0.0.1/magento/index.php/rest/V1/categories/?searchCriteria[filter_groups][0][filters][0]...
0
votes
0
answers
129
views
Magento Filter search on search page
Is there any way around that I can filter search result using via search.
Example : Suppose I am on home page and there I searched "blue" in the search box.
Now I am on the search result page ({{...
4
votes
0
answers
659
views
Magento 2 - Changing Default Search Query Behavior
I have the following search criteria:
/?free_from%5B%5D=265&free_from%5B%5D=266
I'm trying to query all products and return ONLY products with both options A and B selected for the custom ...
4
votes
1
answer
597
views
Magento 2: difference between Api\SearchCriteriaBuilder and Api\Search\SearchCriteriaBuilder?
Those two classes are very similar but I don't get the differences and why should one be used instead of another ?
Magento\Framework\Api\Search\SearchCriteriaBuilder => a handful of references in the ...
5
votes
1
answer
3k
views
Using searchCriteria with condition_type operators "from" and "to" in Magento 2.0
I'm trying to use the Get Orders API with searchCriteria to filter Orders with base_subtotal range between two values. But I have only been able to use the lt and gt. I'm unable to use both in the ...
4
votes
2
answers
7k
views
how to use Search rest api in magento 2?
How to get items using search rest apis,example: I want to search watch in mogento2,how can i get the data from rest apis.
Tried like this : http://localhost/magento2/index.php/rest/V1/search?...
5
votes
2
answers
3k
views
Use preconfigured builders (e.g. for SearchCriteria) in Magento 2
Warning, this is a long winded question about module architecture. I'm not mad if it gets closed as opinion based, but I hope someone has a better idea than me.
In Magento 2 we have builders like the ...
2
votes
1
answer
414
views
Magento search rest api
In the application we are implementing a search function using rest
api. The search will happen using multiple filters. By default,
magento is using "and" operator between filters for producing search
...
0
votes
2
answers
86
views
Search not returning desired results
I'm having problems with the search in my magento webshop. I have different products in my webshop. An example of the name of a product is like this:
BODYSOL KIDS DOUCHE 2IN1 WATERMELOEN 250ML
...
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....
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 ...
5
votes
1
answer
4k
views
Magento 2 API Product Search Option Attributes
I'd like to be able to search products via the API but in my experiments so far I've found that if I am searching for a value of an option attribute (e.g. drop-down list) then I have to specify the ID ...
2
votes
1
answer
3k
views
Filtering data in magento REST API
I use this API to fetch the visible products using the filter:
http://192.168.1.180/magento/index.php/rest/V1/products?searchCriteria[filter_groups][0][filters][0][field]=name&searchCriteria[...
6
votes
1
answer
5k
views
Magento 2 rest api - get orders with products' custom attributes
I would like to have the proper cURL command for getting all pending orders with the products' custom attributes in Magento 2 REST API.
I use this, but there are no custom attributes on the products ...
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 ...
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,
...