Access returned query suggestions from predictive_search object

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>tume",
}

They’re nested in the returned predictive_search object and accessible via:

predictive_search.resources.queries

Hope that helps!