1

I am using magento search rest api. Now i can filter attributes like neck, sleeve, etc.., but i need to give multiple values for same attribute (like mulitple select)

My Request:

rest/V1/search?searchCriteria[requestName]=quick_search_container
&searchCriteria[filterGroups][0][filters][0][field]=category_id
&searchCriteria[filterGroups][0][filters][0][value]=18
&searchCriteria[filterGroups][1][filters][0][field]=filter_color
&searchCriteria[filterGroups][1][filters][0][value]=20
&searchCriteria[filterGroups][1][filters][0][conditionType]=eq
&searchCriteria[filterGroups][1][filters][1][field]=filter_color
&searchCriteria[filterGroups][1][filters][1][value]=22
&searchCriteria[filterGroups][1][filters][1][conditionType]=eq

when multiselect the same attribute(filter_color) it gives the last filter values(for filter_color= 22) only.

And when i am using conditionType = IN like &searchCriteria[filterGroups][1][filters][0][field]=filter_color &searchCriteria[filterGroups][1][filters][0][value]=20, 22 &searchCriteria[filterGroups][1][filters][0][conditionType]=in it gives the result of 0 record. So how to get both attributes filtered items and its aggregation

2
  • Please Help me. – Lovely Setia Jul 19 '18 at 6:25
  • I have one product with two color white,blue.when I call searchCriteria API,this product is not showing in response. – Lovely Setia Jul 19 '18 at 6:27
2

Your are using wrong filter for Search using REST endpoints condition_type type should be

&searchCriteria[filterGroups][1][filters][0][conditionType]=in it gives the result of 0 record. So

Used finset A value within a set of values form multiselect

&searchCriteria[filterGroups][1][filters][0][conditionType]=finset

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.