Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
The shopify documentation shows that it is possible to request for suggested query terms along with products and collections when performing predictive search.
but when i go to the developer documentation to actually implement it, there is no mention of the "query" option in the returned predictive_search_resources object. so i don't find any actually practical solution to this.
any help would be appreciated!
Thank you!
Several months later and still no mention in the docs.
Did you manage to solve this in the end Husseiny?
Found an example of the returned query object in the documentation.
{
"url": STRING e.g, "/search?_pos=1&_psq=cos&_ss=e&_v=1.0&q=costume",
"text":STRING,
"styled_text": STRING e.g, "<mark>cos</mark><span>tume</span>",
}
They're nested in the returned predictive_search object and accessible via:
predictive_search.resources.queries
Hope that helps!
Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025Expand into selling wholesale with Shopify Academy’s learning path, B2B on Shopify: Lau...
By Shopify Jan 28, 2025