Broken Admin GraphQL Search

Highlighted
Tourist
19 0 0

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

0 Likes
Highlighted
Shopify Expert
4175 29 400

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.

 

 

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
0 Likes
Highlighted
Tourist
19 0 0

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

0 Likes
Highlighted
Shopify Expert
4175 29 400

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.

 

 

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
0 Likes
Highlighted
Tourist
19 0 0
Could you please point me to the search api link?

Thanks!
0 Likes