Skip to main content

predictive_search_resources

Contains arrays of objects for each resource type that can be returned by a predictive search 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 %}

Properties

Anchor to
articles
array of article

The articles associated with the query.

Anchor to
collections
array of collection

The collections associated with the query.

Anchor to
pages
array of page

The pages associated with the query.

Anchor to
products
array of product

The products associated with the query.

{
"articles": [],
"collections": [],
"pages": [],
"products": []
}
Was this section helpful?