Skip to main content
Anchor to PredictiveSearchResult

PredictiveSearchResult

object

Returned by the predictiveSearch query to power type-ahead search experiences. Includes matching Product, Collection, Page, and Article objects, along with query suggestions that help customers refine their search.

•[Article!]!
non-null

The articles that match the search query.

Show fields
•[Collection!]!
non-null

The articles that match the search query.

Show fields
•[Page!]!
non-null

The pages that match the search query.

Show fields
•[Product!]!
non-null

The products that match the search query.

Show fields
•[SearchQuerySuggestion!]!
non-null

The query suggestions that are relevant to the search query.

Show fields

Was this section helpful?

•query

Returns suggested results as customers type in a search field, enabling type-ahead search experiences. The query matches products, collections, pages, and articles based on partial search terms, and also provides search query suggestions to help customers refine their search.

You can filter results by resource type and limit the quantity. The limitScope argument controls whether limits apply across all result types or per type. Use unavailableProducts to control how out-of-stock products appear in results.

Show fields

Arguments

•Int

Limits the number of results based on limit_scope. The value can range from 1 to 10, and the default is 10.

•PredictiveSearchLimitScope

Decides the distribution of results.

Show enum values
•String!
required

The search query.

•[SearchableField!]

Specifies the list of resource fields to use for search. The default fields searched on are TITLE, PRODUCT_TYPE, VARIANT_TITLE, and VENDOR. For the best search experience, you should search on the default field set.

The input must not contain more than 250 values.

Show enum values
•[PredictiveSearchType!]

The types of resources to search for.

The input must not contain more than 250 values.

Show enum values
•SearchUnavailableProductsType

Specifies how unavailable products are displayed in the search results.

Show enum values


Was this section helpful?