Broken Admin GraphQL Search

Hi,

I am currently testing my development store and private app. I am trying out Admin GraphQL API to search among my store products. Though in couple of forum topics its mentioned it supports partial search using “query:title:xxx” format by wrapping the string around **. But it does not seem to work. As per search syntax documentation it has only prefix search.

I would like to know is partial search not supported? If it is supported how can i do that?

Thanks,

Sourav

Query search on title does work. I just tested it, and for all the keywords I tried, I got nice results.

{ products(first: 20, query:"title:*dark*") {
  pageInfo {
    hasNextPage
  }
  edges {
    node {
      ... on Product {
        id
        title
        vendor
        productType
        
      }
    }
  }
} 
}

Gave me the products with “dark” in the title.

I have created 2 test products

  • Sourav test 1
  • Sourav test 2

If I use

{ products(first: 20, query:"title:test*") {
  pageInfo {
    hasNextPage
  }
  edges {

    node {
      ... on Product {
        id
        title
        vendor
        productType
        
      }
    }
  }
} 
}

it returns fine

but if I do

{
  products(first: 20, query: "title:*est*") {
    pageInfo {
      hasNextPage
    }
    edges {
      node {
        ... on Product {
          id
          title
          vendor
          productType
        }
      }
    }
  }
}

it does not return anything

Yup.

Well, you know, real soon now, likely in 2020, Shopify will probably turn on an internal search engine that will allow your style of query. In the meantime, try their search endpoint, and use it as a substitute. It’ll give you lots of results. You may not like that either. No one said precision was easy.

Could you please point me to the search api link?

Thanks!