predictive_ search
Information about the results from a predictive search query through the Predictive Search API.
The object returns results only when rendered in a section using the Predictive Search API and the
Section Rendering API. To learn about how to include predictive search in your theme,
refer to Add predictive search to your theme.
Properties
Returns
true
when being referenced inside a section that's been rendered using the Predictive Search API and the Section Rendering API. Returnsfalse
if not.- resources
The resources associated with the query.
You can check whether any resources of a specific type were returned using the
size
filter.{% if predictive_search.resources.articles.size > 0 %}{% for article in predictive_search.resources.articles %}{{ article.title }}{% endfor %}{% endif %}The entered search terms.
TipUse the
highlight
filter to highlight the search terms in search results content.The object types that the search was performed on.
Searches can be performed on the following object types:
NoteThe types are determined by the
type
query parameter.
{
"performed": true,
"resources": {},
"terms": "potion",
"types": []
}