Exact Search vs Contains Search Product Api

5 0 1

Update on the search endpoint: Shopify uses a general search interface across API and products. This is documented here - https://help.shopify.com/en/api/getting-started/search-syntax.


For the APIs, the ability to search for a resource is defined in that resource's docs. At the beginning of that document it states that the Admin API endpoint `/search.json' is available only for Customer and GiftCard. That same endpoint for Product does not appear to be supported.

8 0 10

Try specifying the latest api version in the URL and you will see it no longer returns the contains results and only returns the exact match results.  We are currently using the older 04-2019 version and it continues to provide the contains results, this is a short term fix, not a long term solution.


The issues on this thread are;


1) Lack of communication from Shopify, leaving the community to guess what is going on.  Is this a defect or is it intentional?

2) Later versions of the API not supporting contains search on product title and no stated and supported path forward for developers to achieve that result.

3) The obvious need for such feature, as it was supported in previous versions of the API, it's used in many of our apps, and it's obvious use and need in the Shopify API.


Shopify needs to weigh in here to let us know if it's intentional, (where this change is documented and when it was communicated), and what the go forward path is to search for products via the api.  Anything short of this I consider mismanagement of the API resource and a disservice to customers and partners alike.  Sorry to sound harsh, but this is not being well managed.



@Greg_Kujawa wrote:

I just tried this and it was a "loose" search results set that was passed back in the API response. Here was my API query:


GET https://{myShop}.myshopify.com/admin/products.json?title=test 

The results set that came back included any products that had the word test in them. Not just the products that only had the word test in them. Like below...


{"products":[{"id":4360783429684,"title":"Publish Scope Test","body_html":"\u003cstrong\u003eHello World!\u003c\/strong\u003e","vendor":"Diamond Cellar","product_type":"Test","created_at":"2019-11-19T15:03:47Z","handle":"publish-scope-test","updated_at":"2019-11-19T15:16:48Z","published_at":null,"template_suffix":"","tags":"","published_scope":"global","admin_graphql_api_id":"gid:\/\/shopify\/Product\/4360783429684","variants":[{"id":31265108754484,"product_id":4360783429684,"title":"Default Title","price":"0.00","sku":"","position":1,"inventory_policy":"deny","compare_at_price":null,"fulfillment_service":"manual","inventory_management":"shopify","option1":"Default Title","option2":null,"option3":null,"created_at":"2019-11-19T15:03:47Z","updated_at":"2019-11-19T15:16:47Z","taxable":true,"barcode":"","grams":0,"image_id":null,"weight":0.0,"weight_unit":"lb","inventory_item_id":32769826947124,"inventory_quantity":0,"old_inventory_quantity":0,"requires_shipping":true...

Since I am not specifying the API version in my URI I assume that it would be hitting the latest production version, API 2019-10, correct?


1 Like
8 0 10


Thanks for the research on the release notes.  This clarifies that at least Shopify intended to remove support for contains searches.   However, they have still failed to provide a path forward for their partners and customers.


The problem is that change makes absolutely no sense for the following reason;


-> If we wanted to use exact search, any developer would provide the product id, not the product title.

-> Any user trying to locate a product will not know the "exact" name of the product.

-> Therefore 3rd party developers are not able to allow customers to find or reference existing products within their Shopify stores.  

1 Like
8 0 10

This feature was supported in previous versions of the API 04-2019 and prior.  And worked within the /products/ api, not the search API.


Confirmed that the search API does not provide a solution to this problem.

1 Like
Shopify Partner
137 8 20

I don't think these challenges are unique to Shopify as a service provider. One of our companies employs Lightspeed Retail in production and we ran into similar hurdles. Once the contract was signed the support level, willingness to fix functionality gaps, partnering to embrace enhancements, etc. quickly dropped off the radar. 


While we are looking to utilize Shopify POS for our main company sites, what affects my comfort level is the relative lack of responsiveness to acknowledge and patch what are pretty glaring gaps. Some examples:


When it comes to the API and any potentially breaking changes, I would expect more than perhaps a last-minute community post with the heads-up. There should be a proactive e-mail notification sent to all Shopify customers and partners, with specifics laid out so that third-party apps can be revised if needed. An example of that goes back to 2016 when TLS 1.0 and 1.1 were retired in terms of API access. No idea that this was going to take place until my apps broke and back then I didn't frequent these community forums very often. 

1 Like
8 0 10

Hey Greg-


Thanks for the note and agree on the sentiment overall.  We all know no software is perfect and eCommerce is rich in depth and situations, so there are many corner cases that are important.  t's somewhat the responsibility of users and partners to highlight challenges and push for responsiveness and solutions.


However, this doesn't need to be one of them as it was clearly fully supported, and it's strikingly easy to support.


I wonder if the Shopify fulfilled/unfulfilled line items in POS is also related to this other issue we are experiencing in the API. (https://community.shopify.com/c/Wholesale-Dropshipping/Fulfillment-API-returns-line-Items-Fulfilled-...) seems related to me.


Appreciate the insights,


1 Like