Search products not found in storefront graphQL in single product

Hi guys,

I am trying to get all product with search option but getting every time empty response.

I have a 2 store with below details

Store 1: 5 Categories , 3 product on each category [ Total 15 product ] (This Store Created 2 month ago)

store 2: 5 Categories , 3 product on each category [ Total 15 product ] (This store created yesterday )

Both store have a all same data with same type of property

I notice that newly created store i am not able to search product in storefront graphQL query

here i am adding my query also

URL : https://.myshopify.com/api/2023-07/graphql.json

JSON query:

{
    products(first: 10 , sortKey: TITLE ,  query: "title:shirt" , reverse: true) {
      edges {
        node {
          id
          title
          description
          descriptionHtml
          handle
          productType
          vendor
          createdAt
          updatedAt
          publishedAt
          tags
          images(first: 1) {
            edges {
              node {
                id
                src
                url
              }
            }
          }
          priceRange {
            maxVariantPrice {
              amount
              currencyCode
            }
            minVariantPrice {
              amount
              currencyCode
            }
          }
          options(first: 100) {
            id
            name
            values
          }
          variants(first: 100) {
            edges {
              node {
                id
                image {
                  url
                }
                price{
                  amount
                  currencyCode
                }
                title
                availableForSale
                quantityAvailable
                selectedOptions {
                  name
                  value
                }
                product {
                  id
                  title
                  updatedAt
                }
              }
            }
          }
        }
      }
      pageInfo {
        hasNextPage
        hasPreviousPage
      }
    }
}

output:

{
    "data": {
        "products": {
            "edges": [],
            "pageInfo": {
                "hasNextPage": false,
                "hasPreviousPage": false
            }
        }
    }
}

Hey @mitulgajjar - this is a tricky one for sure. If “shirt” is only part of a title (for example, the product’s name is something like “My Cool Shirt”), you could run a query like this:

{
products(query:“title:shirt” first:5 ) {
edges {
node {
id
title
description
}
}
}
}

By adding the two “*” symbols in your search syntax, this would allow you to search for items that contain a specific part of their title string. There is a bit more info on hour our query search syntax works here in our dev docs if you haven’t checked it out yet. Hope this helps!

Al | Shopify Developer Support

Hi @ShopifyDevSup Thanks for your reply, yes i know about the search query i have a product exact name with “shirt” but issue is not related to query sting.

I have a same same type of 2 store, in another store its giving me the output but in this store not giving (The latest store that i created 2 day ago )

and my both store all products are also published in sales channel

This issue happen only in newly created store as per my observation.

Hello @mitulgajjar ,

We appreciate the added context in your last reply. If you’re still encountering this behavior on a single store, we’d recommend reaching out directly to Shopify Support. For a more comprehensive investigation, it would be helpful if you could provide any of the following details when reaching out to the team:

  • A link to this post for context
  • The steps you’ve already taken for troubleshooting
  • x-request-id and date header values for any example requests
  • contact our Shopify Support team through the Shopify Help Center here

Thanks again for your patience.

Best,
Shopify Developer Support