The search object

The search object has the following attributes:


Returns true if an HTML form with the attribute action="/search" was submitted successfully. This allows you to show content based on whether a search was performed or not.


Returns an array of matching search result items. The items in the array can be a(n):

You can access the attributes of individual search results by looping search.results.

Search result object_type

Search results have an additional attribute titled object_type which returns the type of each result. This is useful for writing the logic of your search results loop.


Returns the number of results found.


Returns the string that was entered in the search input box. Use the highlight filter to apply a different style to any instances in the search results that match up with search.terms.


Returns an array of strings representing the types the search was performed on. The items in the array can be any combination of article, page, product.

The search types can be seen in the URL parameters of a search page. For example,,product&q=* will have a search.types array containing article and product.