Enabling visitors to search your website
The storefront search is a fully featured, powerful tool for your customers to search across all of your shop's products, articles, and pages.
Using AND, OR and NOT operators
All search terms are by default AND-ed together, so searching for
will search results containing both "artichoke" and "hearts". No joining operators are necessary.
will give results containing at least one of "artichoke" or "hearts".
Searching for results without a term can be done by prefixing the term with a minus sign.
will match things with "artichoke" but not "heart".
Searching only for certain types
You can restrict the type of objects that get returned by the search for the storefront search. For example a realistic use case would be to only return products for your customers and not pages or articles.
To only return products you can include the type query parameter like this:
Or to only search for articles and pages with a certain text in the body:
Where type can be any of combination of product, article, and page separated by commas. All three types are searched for if none are specified.
This can be accomplished using a hidden field in the search form within theme.liquid.
Searching specific fields
Prefix a term with a field name and colon to narrow your search for that term to the specified field.
will search for things with artichoke specifically in their title.
The following fields are available to use:
Related Articles - adding search autocomplete to your storefront.
Want to add an auto-complete search feature to your storefront? Check out the Swiftype app, and using Shopify's built-in search engine to add the same autocomplete feature.