Dears, I am using this API in search:

GET http://domain.com/index.php/rest/V1/search


searchCriteria[requestName]= quick_search_container
searchCriteria[filterGroups][0][filters][0][field] = search_term
searchCriteria[filterGroups][0][filters][0][value] = life

But I always retrieve products results without image as:


How can I retrieve product details included images ?

  • have you get any feasible solution ?? – Hiren Apr 18 '19 at 12:03
  • Do it as custom API – Jsparo30 Apr 18 '19 at 13:54
  • please provide any reference if any – Hiren Apr 24 '19 at 6:31

If you want to perform a fulltext search, the native API you used returns only the product IDs (from the search engine : Mysql or ElasticSearch) that match the search term.

Two approaches :

  1. Do another API calls in order to have product details based on the IDs returned (not perfect for performance)
  2. Create your own API based on this search API in order to load the product collection based on the product IDs retrieved.

It is feasible but need code customization.

Internally, Magento uses this search API request, then store the result in a temp table in order to load the product collection in a second time to display product listing in frontend sorted by score.

| improve this answer | |
  • @Frank, Thank you. It is bad design to call another API to get product details. Can you please check this question magento.stackexchange.com/questions/186036/… ? – Jsparo30 Jul 25 '17 at 13:23
  • Yes, it is recommended to create your own API endpoint and manage the logic inside to format the response based on your search term. I did it on my project by creating a custom ElasticSearch request then loading the product collection filtering by product IDs returned. The best but the hard is to store all your information in ElasticSearch and then retrieve information only from ElasticSearch without Magento SQL requests. – Franck Garnier Jul 25 '17 at 13:36

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.