GraphQL product search by title unexpected results

jason90
Tourist
7 1 0

I have a published app that uses graphQL to fetch a list of products. We have some basic search options, mainly a per page search as well as a search by product title.

However we're running into an issue with a specific set of products belonging to a store that installed our app. They aren't able to get the expected results when searching for products with certain titles.

We asked them to transfer over their product catalogue and these are the results from our test store (with all their products imported in)

# Sample GraphQl request, search by full product name
{
    products(sortKey: ID, first:5, query: "title=\"Nanuk 320\"" ) {
        edges {
            node {
                id
                legacyResourceId
                title
                metafields(first: 3, namespace: "shipping") {
                    edges {
                        node {
                            id
                            value
                            key
                            legacyResourceId
                            namespace
                        }
                    }
                }
            }
            cursor
        }
        pageInfo {
            hasNextPage
            hasPreviousPage
        }
    }
}

# Sample response
# x-request-id: ae5849f9-834f-4aeb-a74a-b097fce11a2c
{
    "data": {
        "products": {
            "edges": [],
            "pageInfo": {
                "hasNextPage": false,
                "hasPreviousPage": false
            }
        }
    },
    "extensions": {
        "cost": {
            "actualQueryCost": 2,
            "requestedQueryCost": 32,
            "throttleStatus": {
                "currentlyAvailable": 998,
                "maximumAvailable": 1000.0,
                "restoreRate": 50.0
            }
        }
    }
}

 

For this query, we're expecting at least a single result for a product with the full title of "Nanuk 320", but its not showing up in the results. This is just one example of many from their product catalogue where this strange behaviour happens.

So how do you explain this search behaviour? Is there something missing from the search query to get more accurate results in cases like this (full title search)? Is there an issue with the product or products themselves?

 

I can provide other examples of missing search results if necessary. Thank you.

0 Likes
HunkyBill
Shopify Expert
4561 48 512

I don't think search has ever worked well. If you care to check Google, Twitter, or another source of information, you'll see lots of agencies, especially Plus types, that complain about how bad Search results continue to be. Apparently, there is an internal movement to Elastic Search that should fix this, but as you are finding out, in the meantime, all bets are off. I have consistently been burnt by this too, and leave it to the future for fixing.

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