Storefront API: Can I exclude results that are a partial match?

Kyl
Tourist
5 0 1

I am wondering if I can search tags in the Storefront API but only return results where the search query is an exact match for the entire tag and does not return results where the search query is an exact match for part of the tag.

 

Take the following example:

 

 

{
  products(first:250, query:"tag:'peas'") {
    edges {
      node {
        id
        title
        tags
      }
    }
  }
}

 

 

 

The query above searches tags that match "peas" but this search will return products that have either or both of the tags "peas" and "peas in a pod".

I am wondering if the API supports refining this query so that it would only match the "peas" tag and would not return results for the "peas in a pod" tag without explicitely stating that the results should NOT equal "peas in a pod".

0 Likes