Storefront API: search within a variant-scoped collection without scanning every product?

We’re building a Shopify theme app extension using the Storefront API 2026-07.

A collection contains approximately 3,000 products and uses variant-scoped membership configured in Shopify admin. We need to search by product title, vendor, and product type, while showing only the variants/options included in that collection.

Our original root products(query: ..., sortKey: RELEVANCE) search was fast, but returned variants outside the collection’s membership. Checking product-level collection membership doesn’t resolve this.

Our current collection(handle: ...) { products(...) } query preserves the collection-scoped variants. However, we must paginate through the collection and perform text matching locally. At 250 products per page, this requires approximately 12 sequential requests, with customers reporting searches taking around 20 seconds when fetching product and variant details.

Two possible API capabilities would address this:

  1. Filter Collection.products by product IDs. Use root product search to find matching IDs, then fetch those products within collection context, preserving their included variants/options.
  2. Support text search directly on Collection.products across product title, vendor, and product type, while retaining collection context.

Currently, Collection.products appears to have no query or ids argument, and ProductFilter appears to have no product-ID filter.

Is either approach supported in 2026-07 or a later version? If not, is there another supported Storefront-only approach that avoids scanning the entire collection?

Hi @Benny_Chan I had a good look into this and it’s no on both counts I’m afraid. Collection.products takes no query or ids argument and ProductFilter has no product-ID or collection field. I verified this against the 2026-07 and unstable schemas. Root products and search also can’t be scoped to a collection, so there’s no supported Storefront-only way to intersect a full-text match with collection membership.

Vendor and product type are already solvable in collection context though. With Search & Discovery filters set up, collection(handle:) { products(filters: [{productVendor: "..."}, {productType: "..."}]) } works and preserves variant-scoped membership. Only free-text title matching doesn’t work here.

I agree searching within a collection’s products directly would be ideal here. I can’t promise anything, but I’ve passed the use case along for consideration going forward. Thanks for raising that gap here!