Storefront search is based on [query parameters](#query-parameters) that determine what information is returned, and how it’s returned, in the search results. In addition to the search query itself, there are parameters that allow you to customize the search in the following ways: - Only search for certain resource types - Choose whether unavailable products are returned, and where in the results - Enable partial word matches The query parameters can be used by including inputs in your [search form](#the-search-form), and they’re reflected in the [search URL](#search-url-structure) when a search is performed. > Tip: > To learn more about storefront search functionality and search query options, refer to the [Shopify Help Center](https://help.shopify.com/manual/online-store/storefront-search). You can also add predictive search to your theme so that suggested results appear immediately as you type into the search field. To learn about predictive search, refer to [Add predictive search to your theme](/docs/storefronts/themes/navigation-search/search/predictive-search). The [Shopify Search & Discovery app](https://apps.shopify.com/search-and-discovery) enables users to customize product recommendation and search results, which can impact results from storefront search and the Ajax [Product Recommendations](/docs/api/ajax/reference/product-recommendations) API. To learn about how these results can be impacted, visit the [Shopify Help Center](https://help.shopify.com/manual/online-store/search-and-discovery/product-recommendations). ## Query parameters Search queries accept the following parameters:
Query parameter | Type | Required | Description |
---|---|---|---|
q |
String | Yes | The search query. |
type |
Comma-separated values | No |
Specifies the type of results requested. The possible options are:
Defaults to all types. To change the default value, you can use Search Settings in the Search & Discovery app. |
page |
Integer | No | Specifies the current search results page. Defaults to 1 . |
options |
Hash | No |
Specifies search options that you can customize with the unavailable_products and prefix settings.
|
unavailable_products |
String | No |
Specifies whether to display results for unavailable products or variants in filtered results. The following are the possible options:
Defaults to To change the default value, you can use Search Settings in the Search & Discovery app. |
prefix |
String | No |
Specifies whether we want to perform a partial word match on the last search term. For example, if "winter snow" is used as a search query, a search will find all applicable resources that contain both "winter" and any term that starts with "snow". This could be terms like "snow", "snowshoe", or "snowboard". The possible options are:
|
sort_by
|
String | No |
Specifies the sort order of the results. The possible options are:
Defaults to |