List of the predictive search results.


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

Decides the distribution of results.

The search query.

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.

The types of resources to search for.

The input must not contain more than 250 values.

Specifies how unavailable products are displayed in the search results.


Was this section helpful?

A predictive search result represents a list of products, collections, pages, articles, and query suggestions that matches the predictive search query.


Was this section helpful?
Retrieve predictive search results
Hide code
DescriptionCopy
query suggestions($query: String!) {
  predictiveSearch(query: $query) {
    queries {
      text
    }
    collections {
      id
    }
    products {
      id
    }
    pages {
      id
    }
    articles {
      id
    }
  }
}
Hide code
Response
JSON
{
  "predictiveSearch": {
    "queries": [
      {
        "text": "snowboard"
      },
      {
        "text": "oxygen snowboard"
      },
      {
        "text": "3d snowboard"
      },
      {
        "text": "huebert hydroxy snowboard"
      }
    ],
    "collections": [
      {
        "id": "gid://shopify/Collection/1"
      }
    ],
    "products": [
      {
        "id": "gid://shopify/Product/1"
      },
      {
        "id": "gid://shopify/Product/2"
      },
      {
        "id": "gid://shopify/Product/3"
      }
    ],
    "pages": [
      {
        "id": "gid://shopify/Page/1"
      }
    ],
    "articles": [
      {
        "id": "gid://shopify/Article/1"
      }
    ]
  }
}